-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to click "stop debugging" twice to actually stop debugging, while launching app on android #2389
Comments
@DanTup Same behavior while launching on ios. Off course low priority. |
I can't repro this (even when at a breakpoint), however the next version has some changes to the shutdown code (to resolve the issue when stopping test runs), so I'll build a beta shortly and post the link here so you can test whether the other fix also addresses this. Thanks! |
There's a beta build here: https://github.com/Dart-Code/Dart-Code/releases/tag/v3.10.0-beta.3 Let me know if you're still seeing the same issues with that. Thanks! |
Same behavior, now even more apparent, due to the new pop up: #2380 (comment) Could you try to click stop immediately after you launched the session, if I wait longer I can't reproduce either. Vidoe of Log capture: https://imgur.com/nKDS6Q0 Logs: BTW: I just want to thank you for the amazing work you are doing. I would love to thank you on every issue. But I know that those replays would just fill your mailbox. So consider 👍 as a thank you! |
@HerrNiklasRaab thanks! I realise now that when I came back to test this, I overlooked the "while launching" part. I think this may be a Flutter issue I've seen before, but thought it was specific to flutter_tester. I'll do some poking. Thanks! |
Ok, I think I know what's going on.
When we launch Flutter, it's launched in a shell process. Terminating is a bit unreliable because when we send a SIGINT to the shell, sometimes it does not get passed on to the contained process. To fix this, all of the Dart/Flutter tools send use their PID as the start, and we will terminate those processes directly too. In the log here (and I can repro this), there is a delay between starting to launch the session, and us getting the PID. During this period, if you terminate, we can only terminate the shell process, which orphans the Flutter process and it carries on running. If you wait until the PID has been returned, then things are terminated correctly. Two possible fixes:
|
Doesn't seem like 1 will work, as the pid-file is written immediately before the I've implemented 2. It'll wait up to 20 seconds for the PID when terminating (if it expects one to come). If the tests all pass, I'll make a new build you can try out. |
@HerrNiklasRaab I've made a build with the above changes and published it here: https://github.com/Dart-Code/Dart-Code/releases/tag/v3.10.0-termination.pid.test Could you try it out and ensure it resolves your issues? You might see a small delay between clicking Stop and it actually ending (depending on the timing between you clicking it and the Flutter process emitting its pid), but it shouldn't really be more than a few seconds (and will be shorter the more time elapses before you hit stop). |
I can confirm: The fix is working. 👍 |
Great, thanks for confirming! I'll merge the change in and make a new beta build (since I have another fix for main method CodeLens to include too). |
This is a followup on #2380 (comment).
This is is how it looked while capturing the logs: https://imgur.com/RRqP3gT
These are the logs:
The text was updated successfully, but these errors were encountered: