Repository navigation
Exit reliably on backend disconnect - #128
Merged
Sjors merged 3 commits intoSep 30, 2026
Merged
Conversation
Preserve graceful cleanup while returning EXIT_FAILURE when the mining backend disconnects, so supervisors can restart a fresh process. Requested shutdown continues to return EXIT_SUCCESS. Add a five-second delay to the systemd restart policy and update the integration scenario to assert the failure status and PID-file cleanup.
Register a backend disconnect handler before libmultiprocess's cleanup handler. Remove the PID file and call _Exit(EXIT_FAILURE) so IPC thread teardown cannot race with connection cleanup. The context hook and inline connection setup are temporary parts of the workaround for libmultiprocess PR #361, and can be removed together once its fix is imported. Requested shutdown still uses normal cleanup and returns success.
Continue the mining scenario into the backend disconnect checks while its SRI pool is still connected. Previously the scenario returned after mining, leaving backend disconnect behavior with an active pool unchecked. Require failure exit status, the disconnect log, and PID-file removal before reporting success.
Sjors
added a commit
that referenced
this pull request
Sep 30, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Report backend disconnects as failures so systemd restarts sv2-tp, with a five-second delay. Requested shutdown still exits successfully.
Temporarily remove the PID file and exit before IPC cleanup to avoid the race addressed by libmultiprocess #361. Extend the mining scenario to verify backend loss while the SRI pool remains connected.