[tools] add Stdio to AppContext created by daemon AppInstance#15268
[tools] add Stdio to AppContext created by daemon AppInstance#15268yjbanov merged 1 commit intoflutter:masterfrom
Conversation
|
But when it's not in the Can you set up the code to force it to lose the race in order to verify this theory? |
|
I thought this was the parent context, but let me test this theory. Also, I'll check if I can reliably reproduce this. I only get this in 20% cases on one of the devicelab machines. |
If this is being run via |
|
This happens when running |
|
|
|
@tvolkert and I just had a offline conversation. The issue seems to be in the |
|
Full issue described here: #15352 |
Fixes #14636 ... hopefully. My understanding after some debugging is that
ResidentRunnerattempts to print "Service protocol connection closed." when the device-side VM service closes the connection. Simultaneously, the resident process itself is attempting to shutdown. Hence the race: if the resident process shuts down first, it never gets the notification about the severed connection and makes no attempt to print the aforementioned string. However, if it loses the race it attempts to useStdiofrom theAppContextin the currentZone. Unfortunately, the daemon never addsStdioto theAppContextand so it crashes withNoSuchMethodError.The fix seems to be to simply add
Stdioto theAppContext🤞/cc @DanTup @tvolkert