You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/10/18 11:16:53 UTC
(maven-mvnd) branch master updated: Return the daemon to Idle when no build request arrives in time
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
The following commit(s) were added to refs/heads/master by this push:
new cd4e22f6 Return the daemon to Idle when no build request arrives in time
cd4e22f6 is described below
commit cd4e22f6c574c30721a3a50c0692d95b6f998d34
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Wed Oct 14 23:07:59 2026 +0200
Return the daemon to Idle when no build request arrives in time
CompletableFuture.get(timeout) throws TimeoutException rather than
returning null, so the existing null branch never ran. A new daemon
starts Busy, and when its first client sent no request it stayed Busy,
was never reused and never idle-expired.
Refs #1839
---
daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java
index 3e386692..9948ddd4 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java
@@ -39,6 +39,7 @@ import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@@ -276,7 +277,12 @@ public class Server implements AutoCloseable, Runnable {
request.complete(message);
})
.start();
- Message message = request.get(1, TimeUnit.MINUTES);
+ Message message;
+ try {
+ message = request.get(1, TimeUnit.MINUTES);
+ } catch (TimeoutException e) {
+ message = null;
+ }
if (message == null) {
LOGGER.info("Could not receive request after one minute, dropping connection");
updateState(DaemonState.Idle);