Prevent web apps from freezing after hot-restarts triggered from DevTools#9125
Prevent web apps from freezing after hot-restarts triggered from DevTools#9125elliette merged 4 commits intoflutter:masterfrom
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.
We should make sure this doesn't cause issues for non-web apps.
There was a problem hiding this comment.
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.
Do you happen to know why we do this? This feels like a bug.
There was a problem hiding this comment.
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.
Yeah, I think this is a bug. Can you file an issue against DWDS and reference it here?
kenzieschmoll
left a comment
There was a problem hiding this comment.
LGTM but would like @bkonyi to approve as well.
bkonyi
left a comment
There was a problem hiding this comment.
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.
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).