diff --git a/packages/mosaic/framework/tools/wake/detector.sh b/packages/mosaic/framework/tools/wake/detector.sh index 36d6fe90..fd5f4389 100755 --- a/packages/mosaic/framework/tools/wake/detector.sh +++ b/packages/mosaic/framework/tools/wake/detector.sh @@ -531,7 +531,13 @@ cmd_run() { [ "$once" -eq 1 ] && break # Close the detector lock fd in the sleep child; otherwise an orphaned sleep # keeps the single-instance flock (fd 9, taken at exec 9> above) alive after - # the detector parent dies, and no replacement instance can ever acquire it. + # the detector parent dies. The lock is non-blocking (`flock -n`, above), so + # for as long as that sleep survives a replacement instance is REFUSED and + # exits rather than queueing. The window is BOUNDED by one poll interval + # (WAKE_DETECTOR_INTERVAL, default 30s): when the orphaned sleep exits the + # last copy of the fd closes and the next start succeeds. The cost is a + # restart window in which every supervisor retry fails — not a lock that + # nothing can ever reclaim. # `9>&-` closes ONLY the child's copy — the parent's lock is unaffected. sleep "$interval" 9>&- done