Repository navigation
feat(worker): add graceful shutdown and zombie worker process reaper for sync-rpc - #754
Closed
thinhnx128 wants to merge 1 commit into
Closed
thinhnx128 wants to merge 1 commit into
thinhnx128 wants to merge 1 commit into
Conversation
Author
|
I have read the Arakoo CLA Document and I hereby sign the CLA |
thinhnx128
force-pushed
the
feat/worker-graceful-shutdown-zombie-reaper
branch
from
October 31, 2026 05:06
a937f0a to
2bb5ffb
Compare
Author
|
Closing this to reduce review load — it wasn't requested by the maintainers. Thanks for your time; happy to reopen if it's useful. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements graceful shutdown (
SIGTERM,SIGINT,SIGHUP) and automatic zombie worker / orphaned temporary directory reaping for EdgeChains worker processes:Key Changes
JS/wasm/sync-rpc/index.js— Active Worker Registry & Two-Phase Reaper:activeWorkersand installs idempotent signal handlers (exit,SIGINT,SIGTERM,SIGHUP).SIGTERMfollowed bySIGKILLescalation after 1.5s if the worker remains hung) so background workers are never left orphaned holding TCP ports.EDGECHAINS_PARENT_PIDto the child worker.JS/wasm/sync-rpc/worker.js— Parent Liveness Watchdog & Graceful Server Drain:process.kill(parentPid, 0)every 1s and triggersgracefulShutdown(0)if the parent process dies unexpectedly.SIGINT/SIGTERMhandlers and a"shutdown"command that drains active connections viaserver.close()before exiting, while binding to loopback (127.0.0.1).JS/edgechains/arakoodev/src/sync-rpc/lib/sync-rpc.ts— Automatic Temp Directory Cleanup:sync-rpc-*temporary directories inactiveTempDirsand cleans them up on process exit/signals (fs.rmSync(dir, { recursive: true, force: true })), plus exposessyncRPC.dispose().