Preserve the Flow SIGTERM handler in AM callbacks - #164
Draft
robjarawan wants to merge 2 commits into
Draft
Conversation
Test Results376 tests 375 ✅ 1m 44s ⏱️ Results for commit 05b1095. |
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.
Fixes #163.
The AM gather and send callbacks were replacing the instance
SIGTERMhandler withSIG_DFLwhen they were constructed. So a normalSIGTERMkilled the process immediately instead of callingFlow.stop_request()and letting the normalon_stopcleanup run.So what I did was leave the instance handler in place. I added a regression test that starts a real child process, installs
sarracenia.instance.instance.stop_signal, constructs each real AM callback, and sends the child an actualSIGTERM.Before this change, both children reported
parent_handler_preserved: false, returned no shutdown result, and exited with-15. After the change, both callbacks preserve the handler, request the Flow stop, close their sockets, and exit with0.I also checked this together with the existing partial-send fix from #119. That commit applies cleanly and all 22 combined AM tests pass.
Tests:
tests/sarracenia/flowcb/am_signal_test.py: 2 passedThis branch also includes the local-fixture CI repair from #140 so the fork maintenance jobs do not depend on public dynamic flows.
Related upstream work: MetPX#1653. I have left that upstream PR unchanged; this draft is based on the current fork
developmentbranch and contains the stronger real-signal regression proof.