mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-20 10:44:59 +00:00
* Run client connection handler inside new thread, fixes #798 * Execute CI build on ubuntu-22.04 * ubuntu-18.04 image is now deprecated and there are brownout periods being introduced where the builds are failing * see https://github.com/actions/runner-images/issues/6002 for more details
This commit is contained in:
2
.github/workflows/early-access.yaml
vendored
2
.github/workflows/early-access.yaml
vendored
@@ -34,7 +34,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-18.04, macOS-10.15, windows-2019 ]
|
os: [ ubuntu-22.04, macOS-10.15, windows-2019 ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@@ -239,7 +239,16 @@ public class Server implements AutoCloseable, Runnable {
|
|||||||
try {
|
try {
|
||||||
while (true) {
|
while (true) {
|
||||||
try (SocketChannel socket = this.socket.accept()) {
|
try (SocketChannel socket = this.socket.accept()) {
|
||||||
client(socket);
|
try {
|
||||||
|
// execute the client connection handling inside a new thread to guard against possible
|
||||||
|
// ThreadLocal memory leaks
|
||||||
|
// see https://github.com/apache/maven-mvnd/issues/798 for more details
|
||||||
|
Thread handler = new Thread(() -> client(socket));
|
||||||
|
handler.start();
|
||||||
|
handler.join();
|
||||||
|
} catch (Throwable t) {
|
||||||
|
LOGGER.error("Error handling a client connection", t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
@@ -270,7 +279,7 @@ public class Server implements AutoCloseable, Runnable {
|
|||||||
updateState(DaemonState.Idle);
|
updateState(DaemonState.Idle);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOGGER.info("Request received: " + message);
|
LOGGER.info("Request received: {}", message);
|
||||||
if (message instanceof BuildRequest) {
|
if (message instanceof BuildRequest) {
|
||||||
handle(connection, (BuildRequest) message);
|
handle(connection, (BuildRequest) message);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user