Merged
Conversation
5 tasks
jacob314
approved these changes
Mar 7, 2019
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.
In the editors, we have a bit of an ongoing battle with making sure we clean up processes correctly across all platforms. In many cases the process we spawn is not the real process that runs (for example on Windows running
pub.batcan only be run with shellExecute, but then that runsdart.exewith the pub snapshot - so the process we spawned is at least two steps from the one we care about).For reasons I do not entirely understand, we often see that sending a
SIGINTorSIGTERMdoesn't get passed down the chain correctly and we end up leaving processes hanging around. In Dart, Flutter and Flutter Test we've exposed the real PID as part of the JSON API to allow editors to also send signals to the process directly to improve the chances of terminating the process.I can't repro leaked processes locally on macOS, however my integration tests for Dart Code are failing because I throw errors if there are Dart processes running at the end of a test run, and the DevTools ones are hanging round. The PID of the process that remains is 1 higher than the process I had a handle to (because of
pub global run devtoolsspawningdart snapshots/pub.dart.snapshot) but the kill signals were not handled correctly.Here, we call kill() (which sends SIGINT), then wait 5 seconds and send SIGKILL, but then at the end, there's still a process (with pid+1) hanging around.
(@devoncarew @pq FYI, I'm not sure if you have all these issues in IntelliJ - if not, it'd be interested to know why not!)