-
Notifications
You must be signed in to change notification settings - Fork 361
Prevent web apps from freezing after hot-restarts triggered from DevTools #9125
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
Conversation
| // We check for a resume event because package:dwds sends a resume event | ||
| // after a hot-restart. See: | ||
| // https://github.com/flutter/devtools/issues/9124 | ||
| EventKind.kResume, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make sure this doesn't cause issues for non-web apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed! Testing now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed non-web apps still work as expected. Also looking into what is required to reenable the debugger panel integration test on web, since I believe that would have caught this regression: #7732
| if ([ | ||
| EventKind.kPauseStart, | ||
| EventKind.kPausePostRequest, | ||
| // We check for a resume event because package:dwds sends a resume event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you happen to know why we do this? This feels like a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A very good question (that could perhaps also be asked about other related code, for example why is the notifyPausedAtStart method not notifying), but from my investigation:
-
Here is where the
resumeFromStartmethod (which calls the_resumeHandlerwhich sends theResumeevent) was added:
Properly set the pauseEvent dart-lang/webdev#636 -
And here is where it began to be called in response to "creating a new isolate" (which is not a real isolate since there are no isolates on web) and occurs in response to a hot-restart:
Faster DevTools launch dart-lang/webdev#747
(For reference, current code pointers here: #9124 (comment))
So dwds is sending the Resume event to say "the isolate has been created and resumed." At least that is my understanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think this is a bug. Can you file an issue against DWDS and reference it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Filed dart-lang/webdev#2610
kenzieschmoll
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but would like @bkonyi to approve as well.
bkonyi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, but let's file a bug against DWDS to see if we can fix this behavior there since it's not consistent with what the VM does.
| if ([ | ||
| EventKind.kPauseStart, | ||
| EventKind.kPausePostRequest, | ||
| // We check for a resume event because package:dwds sends a resume event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think this is a bug. Can you file an issue against DWDS and reference it here?
Fixes #9124
I still need to do some testing to make sure this doesn't introduce a regression to our breakpoint handling (although I think if the VM Service sends a
resumeevent it should be safe for us to callresumeas well).