Flutter-intellij: File descriptor leak in PluginConfig.load()

Created on 8 Mar 2019  Â·  8Comments  Â·  Source: flutter/flutter-intellij

Android Studio 3.5 Canary 6 with Flutter plugin v33.3.2 runs out of file descriptors on Mac, subsequently failing every I/O call with "Too many open files".

A quick lsof inspection of the process showed ~10K entries for config/intellij-plugins/flutter.json.

One idea: does PluginConfig.load() close the InputStreamReader, or should that be a try-with-resources in
https://github.com/flutter/flutter-intellij/blob/master/src/io/flutter/bazel/PluginConfig.java#L75
(I don't know if GSON.fromJson() is supposed to close it.)

bug

All 8 comments

Thanks for the (very precise!) report. It does look like we're leading resources there.

Super report. That you @rsauciuc!

Nice! Thanks for the quick fix!
What's a good way to track which version of the Flutter plugin this fix will be in? I'd like to verify this is the root cause of another issue I've been seeing.

It should be in the next release which will be 34.0.

You can see versions with changelogs here:

https://plugins.jetbrains.com/plugin/9212-flutter

Depending on @DaveShuckerow's eval of the fix, if may be worth doing a patch release to capture this fix.

I'm checking open files with lsof -p <aswb pid> | wc -l to count the number of open files.

Here's my results with the fix pulled down:

➜  google3 lsof -p 71205 | wc -l     
     140
➜  google3 lsof -p 71205 | wc -l
     140
➜  google3 lsof -p 71205 | wc -l
     145
➜  google3 lsof -p 71205 | wc -l
     145
➜  google3 lsof -p 71205 | wc -l
     142
➜  google3 lsof -p 71205 | wc -l
     140

I'm running ASWB 3.4 Beta 4.

I think we should cherrypick this.

@DaveShuckerow, do you mind driving the cherry-pick and publishing process? I think it's documented enough, and you should have sufficient access; if not, please let me know and we can correct; thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaveShuckerow picture DaveShuckerow  Â·  3Comments

zoechi picture zoechi  Â·  3Comments

SAGARSURI picture SAGARSURI  Â·  3Comments

ilopX picture ilopX  Â·  3Comments

dark-chocolate picture dark-chocolate  Â·  4Comments