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
Flutter or Dart has been leaking processes on Windows #29141
A routine cause of Windows devicelab failures at this point is that the flutter directory can't be deleted after tests because a flutter (dart.exe) process is still running that should have finished.
We could easily add a script to kill the remaining processes on Windows, but ideally we wouldn't be leaking the process to begin with.
We should:
update our tests on the devicelab to make sure we're not leaking any processes we control at the end. If we do, the test that leaked should fail rather than the next test that can't clean up.
Fix whatever bugs in the tool and/or dart that are causing this leak
I found two leaked dart.exe processes on a Windows machine today that causes this issue, here are the command line of each one.
The parent dart.exe has the command line of
"C:\Users\Win1\.cocoon\flutter\bin\cache\dart-sdk\bin\dart.exe" --packages="C:\Users\Win1\.cocoon\flutter\packages\flutter_tools\.packages" "C:\Users\Win1\.cocoon\flutter\bin\cache\flutter_tools.snapshot" run --hot -d ZY2245DC4Z --benchmark --verbose --resident
...
It looks like that the compiler doesn't exit properly in hot reload mode.
This instance of dart.exe/flutter_tools is supposed to stay resident in memory driven by hot_mode_tests.dart. I would try to capture logs for hot_mode_test.dart and confirm that flutter_tools stdout that hot_mode_test sees matches it's expectations. In particular note how hot_mode_test only exists after what it believes it sees two successful reload requests. It might be that reload doesn't happen, it might be that output is structured slightly differently from hot_mode_tests expectations.
Do we have any sense for how often it's happening now days, and how reproducible it is?
If we're in a situation where we don't know what's causing this and it's extremely flaky, closing the tree over it seems excessive. If it's not normally happening and we think we've fixed the bugs, then we should close the tree if we reintroduce it.
This is happening very frequently on Linux + Android tests. I've seen a few tests failing because the test finished and there were some processes still running. I'll add links when I find another one.
I personally prefer the tests to fail rather than just hiding the error.
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
dnfield commentedon Mar 12, 2019
We may be leaking processes on other platforms too, but Windows is particularly harmful because it causes the subsequent run to fail.
On mac I think we've seen some leaks, which eventually makes the machine unreliable.
dnfield commentedon Mar 19, 2019
For now:
Eventually:
digiter commentedon Jun 27, 2019
I found two leaked dart.exe processes on a Windows machine today that causes this issue, here are the command line of each one.
The parent dart.exe has the command line of
The child dart.exe has the command line of
It looks like that the compiler doesn't exit properly in hot reload mode.
jmagman commentedon Jun 27, 2019
That one looks similar to #34613.
dnfield commentedon Jun 27, 2019
Looks like that originates in hot_mode_tests.dart: https://github.com/flutter/flutter/blob/master/dev/devicelab/lib/tasks/hot_mode_tests.dart#L26
tvolkert commentedon Jun 27, 2019
@a-siva do you know who on the Dart team might be a good person to take a look?
aam commentedon Jun 27, 2019
This instance of dart.exe/flutter_tools is supposed to stay resident in memory driven by hot_mode_tests.dart. I would try to capture logs for hot_mode_test.dart and confirm that flutter_tools stdout that hot_mode_test sees matches it's expectations. In particular note how hot_mode_test only exists after what it believes it sees two successful reload requests. It might be that reload doesn't happen, it might be that output is structured slightly differently from hot_mode_tests expectations.
digiter commentedon Jun 28, 2019
I forgot to mention that this issue is flaky, it doesn't reproduce every time.
12 remaining items
dnfield commentedon Nov 15, 2019
Do we have any sense for how often it's happening now days, and how reproducible it is?
If we're in a situation where we don't know what's causing this and it's extremely flaky, closing the tree over it seems excessive. If it's not normally happening and we think we've fixed the bugs, then we should close the tree if we reintroduce it.
godofredoc commentedon Nov 15, 2019
This is happening very frequently on Linux + Android tests. I've seen a few tests failing because the test finished and there were some processes still running. I'll add links when I find another one.
I personally prefer the tests to fail rather than just hiding the error.
keyonghan commentedon Nov 21, 2019
Have been keeping an eye on leaking processes on Windows these days, but didn't notice any.
godofredoc commentedon Nov 21, 2019
Let's monitor windows for one more week, if there are not leaked processes we can close this one and open a new one for linux.
zanderso commentedon Jan 15, 2020
@godofredoc @keyonghan What's the status of this?
godofredoc commentedon Jan 15, 2020
We can safely close this one start/kill the agent process differently and it has not been leaking any processes in the last few months.
kontinuity commentedon Jun 27, 2020
Intellij Idea, AVD, everything else was shutdown at the time.
jmagman commentedon Jun 29, 2020
@kontinuity Can you file a new issue at https://github.com/flutter/devtools/issues? This issue wasn't tracking
devtoolsbut they can take a look at that.github-actions commentedon Aug 14, 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.