Repository navigation
fix(devtools): kill the hot-reload child on a second SIGINT - #110
Draft
leoafarias wants to merge 1 commit into
Draft
leoafarias wants to merge 1 commit into
leoafarias wants to merge 1 commit into
Conversation
A child that swallows the forwarded SIGINT left noir:run blocked on exit, because SIGKILL ran only after that exit. The second SIGINT now kills the child while it is still running. Co-authored-by: Leo Farias <[email protected]>
This branch has not been deployed
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.
Bug
noir:runlatches the first SIGINT, forwards it to the child, and SIGKILLs only infinallyafterchild.exitCode. A child that handles SIGINT and stays up (an app withonExitRequested, or any other handler that does not exit) ignores the forwarded signal. A second Ctrl+C is forwarded again and the runner waits forever.Repro
Before the fix, a packaged
noir:runof a child that installs a SIGINT handler and does not exit: the first SIGINT printsSIGINT:1and the runner stays up; the second printsSIGINT:2and the runner never exits.Fix
On a second SIGINT while that latch is set and the child is still running, SIGKILL the child so its exit can complete. Drop the post-exit SIGKILL.
Lines
Runner
+6 / -1. With the packaged test,+68 / -3.Validation
dart format --output=none --set-exit-if-changedforpackages/noir(lib/,test/,example/,bin/,hook/,tool/) — passeddart analyze --fatal-infosinpackages/noir— passeddart test test/bin/run_test.dart test/app/hot_reload_response_test.dart test/hot_reload_e2e_test.dart --concurrency=1— passeddart test test/architecture --concurrency=1— passed