You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Request to Dart VM Service timed out: _flutter.listViews({})" during hot reload #17434
changed the title [-]App Freezes While Performing Hot Reload In VSCODE . [/-][+]TimeoutException: Request to Dart VM Service timed out: _flutter.listViews({})[/+]on May 10, 2018
changed the title [-]TimeoutException: Request to Dart VM Service timed out: _flutter.listViews({})[/-][+]"Request to Dart VM Service timed out: _flutter.listViews({})" during hot reload[/+]on May 10, 2018
Does hot reload always work the first time, and then fail on subsequent attempts?
In these logs, the first one works (which said "Initializing hot reload") but the next one failed (and it instead said "Performing hot reload..."). I'm not sure if there's a difference in what's performed the first time versus others.
[5:34:17 PM]: ==> [{"id":"7","method":"app.restart","params":{"appId":"cd36a340-0ea8-4cd4-80f8-158e72380363","fullRestart":false,"pause":true}}]
[5:34:17 PM]: <== [{"event":"app.progress","params":{"appId":"cd36a340-0ea8-4cd4-80f8-158e72380363","id":"5","progressId":"hot.reload","message":"Initializing hot reload..."}}]
[5:34:18 PM]: <== [{"event":"app.progress","params":{"appId":"cd36a340-0ea8-4cd4-80f8-158e72380363","id":"5","progressId":"hot.reload","finished":true}}]
[5:34:18 PM]: <== Reloaded 3 of 395 libraries in 1,239ms.
[5:34:18 PM]: <== [{"id":"7","result":{"code":0,"message":"Reloaded 3 of 395 libraries"}}]
[5:34:24 PM]: ==> [{"id":"8","method":"app.restart","params":{"appId":"cd36a340-0ea8-4cd4-80f8-158e72380363","fullRestart":false,"pause":true}}]
[5:34:24 PM]: <== [{"event":"app.progress","params":{"appId":"cd36a340-0ea8-4cd4-80f8-158e72380363","id":"6","progressId":"hot.reload","message":"Performing hot reload..."}}]
[5:35:25 PM]: <== [{"event":"app.progress","params":{"appId":"cd36a340-0ea8-4cd4-80f8-158e72380363","id":"6","progressId":"hot.reload","finished":true}}]
[5:35:25 PM]: <== [{"id":"8","error":"TimeoutException: Request to Dart VM Service timed out: _flutter.listViews({})"}]
On Thu, May 10, 2018, 1:21 PM Danny Tuppeny ***@***.***> wrote:
Does hot reload always work the first time, and then fail on subsequent
attempts?
In these logs, the first one works (which said "Initializing hot reload")
but the next one failed (and it instead said "Performing hot reload...").
I'm not sure if there's a difference in what's performed the first time
versus others.
[5:34:17 PM]: ==> [{"id":"7","method":"app.restart","params":{"appId":"cd36a340-0ea8-4cd4-80f8-158e72380363","fullRestart":false,"pause":true}}]
[5:34:17 PM]: <== [{"event":"app.progress","params":{"appId":"cd36a340-0ea8-4cd4-80f8-158e72380363","id":"5","progressId":"hot.reload","message":"Initializing hot reload..."}}]
[5:34:18 PM]: <== [{"event":"app.progress","params":{"appId":"cd36a340-0ea8-4cd4-80f8-158e72380363","id":"5","progressId":"hot.reload","finished":true}}]
[5:34:18 PM]: <== Reloaded 3 of 395 libraries in 1,239ms.
[5:34:18 PM]: <== [{"id":"7","result":{"code":0,"message":"Reloaded 3 of 395 libraries"}}]
[5:34:24 PM]: ==> [{"id":"8","method":"app.restart","params":{"appId":"cd36a340-0ea8-4cd4-80f8-158e72380363","fullRestart":false,"pause":true}}]
[5:34:24 PM]: <== [{"event":"app.progress","params":{"appId":"cd36a340-0ea8-4cd4-80f8-158e72380363","id":"6","progressId":"hot.reload","message":"Performing hot reload..."}}]
[5:35:25 PM]: <== [{"event":"app.progress","params":{"appId":"cd36a340-0ea8-4cd4-80f8-158e72380363","id":"6","progressId":"hot.reload","finished":true}}]
[5:35:25 PM]: <== [{"id":"8","error":"TimeoutException: Request to Dart VM Service timed out: _flutter.listViews({})"}]
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#17434 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMCOnOBLMGOuwdbHgjKW26ehxrxyKLZwks5tw_F3gaJpZM4T4uQU>
.
@aam@rmacnak-google, we've had issues in the past re: _flutter.listViews({}) and the VM being paused. There's some code in flutter_tools to avoid listing views if it thinks the VM is paused. That code is likely a bit racy however. We may want to consider moving to maintaining the list of views on the flutter_tools side, and adding and removing from the list based on flutter view added / flutter view removed events from the target device.
@zoechi Was that in IntelliJ? We were just discussing whether it might be a timing issue and Dart Code doing something differently to IntelliJ; but maybe it happens there too. Do you normally run with or without the debugger?
@devoncarew I diff'd the good/bad restarts from the log above and the requests are all in the same order (obviously there may be timing variances), though the bad one never got a response to the resume.
I'm not sure how much we can do to change the timing (short of putting little delays in places).
Currently it looks like we wait for PausePostRequest, then we send requests to remove and re-add all breakpoints, then once they're all done, we send the resume.
Currently it looks like we wait for PausePostRequest, then we send requests to remove and re-add all breakpoints, then once they're all done, we send the resume.
OK, this matches what we're doing in IntelliJ; thanks for investigating.
I'm afraid this one is currently a little outside of my knowledge so is going to need some input from someone else. As a temporary workaround you could run from the terminal (though this means no debugger) or disable hot-reload-on-save and use Ctrl+F5 for full restarts (they're still pretty fast, but obviously lose state/position in app).
@DanTup, apologies, no, I don't believe so now. You do want to pause and resend breakpoints since the code might have moved as part of the hot reload. So yes, that is how you could end up in the same non-responsive engine state even if your code was not paused on the breakpoint when you did hot reload.
I'm working on a fix for this.
after reading about breakpoints on this issue I started fiddling with them and got VERY different results.
This is how I fiddled:
The sequence I did was roughly the following:
disable 'break on exceptions'
Add characters one by one to new Text(''), with dart 2 enabled on AS.
hot reload
repeat sequence about 10 times
enable 'break on exceptions'
do steps 2 - 4. On 7th attempt it chocked and presented the usual problem
stop app, disable 'break on exceptions'
create a new new Text(''), launch app again
repeat steps 2 - 4
do step 5 (enable exceptions again)
repeat steps 2 - 4
Now I can't make this project hang at all. Next time it does I'll fiddle again with breakpoints.
Note: I usually disable all breakpoints and have none intentionally added, until this hot reload solves itself.
My logs and setup details were added in #17005 (comment). before this breakpoint fiddling. The only difference now is that I downloaded and launched an emulator based on nexus 5X with Android P, but I could reproduce the problems very easily there yesterday after taking such logs.
Something changed on my setup too in VSCode, I installed the Offical flutter extension in addition to the dart on that was already installed. I would see if it has break on uncaught exceptions enabled by default...
Something changed on my setup too in VSCode, I installed the Offical flutter extension in addition to the dart on that was already installed
This won't make any difference; at this point all of the debugging comes from the Dart extension (the Flutter extension has a dependency on the Dart one, so if you didn't already have it it would install it for you).
I would see if it has break on uncaught exceptions enabled by default...
It's not on by default (it's a tickbox at the bottom left of the debug sidebar). I wouldn't expect this setting to affect the ability for us to resume, but I'm not familiar with what's happening in the VM-side.
That said, from the comment above, I think may @aam may have figured out the issue now :-)
The intended fix for this landed in 89cb5d2 . If folks could give it a try(get latest flutter from master channel/branch) and confirm, that would be awesome!
Reacted by Danny Tuppeny, Günter Zöchbauer, Pawan Kumar and Jeremiah Ogbomo
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[-]App Freezes While Performing Hot Reload In VSCODE . [/-][+]TimeoutException: Request to Dart VM Service timed out: _flutter.listViews({})[/+][-]TimeoutException: Request to Dart VM Service timed out: _flutter.listViews({})[/-][+]"Request to Dart VM Service timed out: _flutter.listViews({})" during hot reload[/+]DanTup commentedon May 10, 2018
Does hot reload always work the first time, and then fail on subsequent attempts?
In these logs, the first one works (which said "Initializing hot reload") but the next one failed (and it instead said "Performing hot reload..."). I'm not sure if there's a difference in what's performed the first time versus others.
iampawan commentedon May 10, 2018
darioielardi commentedon May 10, 2018
same issue here
DanTup commentedon May 10, 2018
Looking at the logs again; we never got a response to the resume request on the second hot reload.. The log ends here:
devoncarew commentedon May 10, 2018
@aam @rmacnak-google, we've had issues in the past re:
_flutter.listViews({})and the VM being paused. There's some code in flutter_tools to avoid listing views if it thinks the VM is paused. That code is likely a bit racy however. We may want to consider moving to maintaining the list of views on the flutter_tools side, and adding and removing from the list based onflutter view added/flutter view removedevents from the target device.zoechi commentedon May 10, 2018
I had this consistently for some weeks but seems to be working now in
devchannel.Update
It happens less frequently, but still happens.
DanTup commentedon May 10, 2018
@zoechi Was that in IntelliJ? We were just discussing whether it might be a timing issue and Dart Code doing something differently to IntelliJ; but maybe it happens there too. Do you normally run with or without the debugger?
zoechi commentedon May 10, 2018
Yes IntelliJ. Always with debugger.
DanTup commentedon May 10, 2018
@devoncarew I diff'd the good/bad restarts from the log above and the requests are all in the same order (obviously there may be timing variances), though the bad one never got a response to the resume.
I'm not sure how much we can do to change the timing (short of putting little delays in places).
Currently it looks like we wait for
PausePostRequest, then we send requests to remove and re-add all breakpoints, then once they're all done, we send the resume.devoncarew commentedon May 10, 2018
OK, this matches what we're doing in IntelliJ; thanks for investigating.
joon610 commentedon May 11, 2018
same issue~~....
iampawan commentedon May 13, 2018
Any update on this issue @DanTup ?
DanTup commentedon May 14, 2018
I'm afraid this one is currently a little outside of my knowledge so is going to need some input from someone else. As a temporary workaround you could run from the terminal (though this means no debugger) or disable hot-reload-on-save and use
Ctrl+F5for full restarts (they're still pretty fast, but obviously lose state/position in app).15 remaining items
aam commentedon May 15, 2018
@DanTup, apologies, no, I don't believe so now. You do want to pause and resend breakpoints since the code might have moved as part of the hot reload. So yes, that is how you could end up in the same non-responsive engine state even if your code was not paused on the breakpoint when you did hot reload.
I'm working on a fix for this.
DanTup commentedon May 15, 2018
@aam Great; thanks!
Enable flutter service protocol rpcs to run on UI isolate.
fmatosqg commentedon May 15, 2018
after reading about breakpoints on this issue I started fiddling with them and got VERY different results.
This is how I fiddled:
The sequence I did was roughly the following:
new Text(''),with dart 2 enabled on AS.new Text(''),launch app againNow I can't make this project hang at all. Next time it does I'll fiddle again with breakpoints.
Note: I usually disable all breakpoints and have none intentionally added, until this hot reload solves itself.
My logs and setup details were added in #17005 (comment). before this breakpoint fiddling. The only difference now is that I downloaded and launched an emulator based on nexus 5X with Android P, but I could reproduce the problems very easily there yesterday after taking such logs.
rodydavis commentedon May 16, 2018
Something changed on my setup too in VSCode, I installed the Offical flutter extension in addition to the dart on that was already installed. I would see if it has break on uncaught exceptions enabled by default...
DanTup commentedon May 16, 2018
This won't make any difference; at this point all of the debugging comes from the Dart extension (the Flutter extension has a dependency on the Dart one, so if you didn't already have it it would install it for you).
It's not on by default (it's a tickbox at the bottom left of the debug sidebar). I wouldn't expect this setting to affect the ability for us to resume, but I'm not familiar with what's happening in the VM-side.
That said, from the comment above, I think may @aam may have figured out the issue now :-)
joon610 commentedon May 16, 2018
re install other version.. and then done~
Enable flutter service protocol rpcs to run on UI isolate. (#5263)
fmatosqg commentedon May 17, 2018
I think I can find an effective workaround the problem.
These are the details:
aam commentedon May 18, 2018
The intended fix for this landed in 89cb5d2 . If folks could give it a try(get latest flutter from master channel/branch) and confirm, that would be awesome!
ThinkDigitalSoftware commentedon May 20, 2018
@aam, Works great! Even when on breakpoints while paused. Nice! Thank you!
aam commentedon May 21, 2018
Thank you for confirmation, @ThinkDigitalRepair !
github-actions commentedon Sep 3, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.