This is an automated email from the ASF dual-hosted git repository.

nickva pushed a commit to branch 3.5.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 54115d184c3e84df352fe9963649e053cfd0c10b
Author: readyprompt <[email protected]>
AuthorDate: Mon Sep 28 22:11:44 2026 -0500

    Escalate to SIGKILL in dev/run teardown
    
    A deadlocked Clouseau node can ignore SIGTERM (its JVM shutdown hook
    wedges), leaving it holding its epmd node name and poisoning the next
    make retry. After SIGTERM, wait a short time for each process to exit,
    then SIGKILL any survivor so the node name is released.
    
    (cherry picked from commit 0c6a10cfba917efcaaa39e80300789f10f8f6266)
---
 dev/run | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/dev/run b/dev/run
index 3b13bb628..e5114c928 100755
--- a/dev/run
+++ b/dev/run
@@ -1031,7 +1031,8 @@ def startup(ctx):
 
 
 def kill_processes(ctx):
-    for proc in ctx["procs"]:
+    procs = ctx["procs"]
+    for proc in procs:
         if proc and proc.returncode is None:
             if os.name == "nt":
                 sp.call(
@@ -1039,6 +1040,23 @@ def kill_processes(ctx):
                 )
             else:
                 proc.terminate()
+    # A deadlocked Clouseau can ignore SIGTERM (its JVM shutdown hook wedges), 
which
+    # leaves it holding its epmd node name and poisons the next `make` retry. 
Give
+    # each process a short grace period to exit on SIGTERM, then SIGKILL any 
survivor.
+    if os.name != "nt":
+        deadline = time.time() + 5
+        for proc in procs:
+            if proc and proc.returncode is None:
+                try:
+                    proc.wait(timeout=max(0.0, deadline - time.time()))
+                except sp.TimeoutExpired:
+                    pass
+        for proc in procs:
+            if proc and proc.poll() is None:
+                try:
+                    proc.kill()
+                except OSError:
+                    pass
     ctx["procs"] = []
 
 

Reply via email to