Comments (9)
Glad to hear it fixes it, though it is puzzling. Out of interest, if you don't close VS Code, does the process forever sit at 100%? If so, it'd be nice to track that down and fix it too (in the first instance I would try enabling the instrumentation log to see if it has an indication of what's happening). We can open a new issue for that so the "fix" for this one can be tracked from this issue in the next release notes.
Thanks!
from dart-code.
Are you able to reproduce this? From the screenshots this looks like the analysis server. It should be terminated when the extension shuts down, but it seems to be using 100% CPU and I wonder whether that's preventing it from closing. It's normal to use a lot of CPU when it's busy, but ofcourse shouldn't all the time.
If you can repro, does this happen for all projects, or only when you open a specific project? If only a specific repo, could you try enabling the instrumentation log and see whether it's writing anything when it's in this state?
from dart-code.
Yep, I can reproduce it easily. All I have to do is open the flutter engine repo in vscode, then close it. I don't even open any dart files. It seems to happen 100% of the time.
from dart-code.
I haven't been able to reproduce this on Windows or macOS, however I don't know if I have the engine repo set up exactly the same as you (I followed the instructions on https://github.com/flutter/flutter/wiki/Setting-up-the-Engine-development-environment to include the third party deps) or exactly which folder you're opening, or how long you've leaving it before closing VS Code. I do see the dart
process live for 5-10s after I close VS Code, but it always seems to disappear.
I can see from the code that we never directly kill()
the process we start for the analyzer, and rely on it closing when the streams are closed by the LSP client. If the server is busy (which it is for a short while when starting up), that might not be immediately.
I've added code that when we dispose the LSP client will kill the process (send sigterm
) after 100ms. This might improve things, but you'd have to test it. I've published in a pre-release version today which you can switch to with this button in VS Code:
The version that includes the fix is v3.89.20240509
(the last component is todays date in YYYYMMDD
format) - it might take 20-30 mins to show up from when I posted this message.
from dart-code.
The surprising thing to me is that you are allowed to get an orphaned process. The default setting should be that killing a parent process kills the children processes. I suspect there may be a setting when forking the child process that we have wrong that allows child processes to get orphaned in the first place.
from dart-code.
Me too, but I'm not familiar with who is usually doing the clean-up of processes like that. The code that spawns the process doesn't do much:
child_process.spawn(binPath, args, { cwd: workingDirectory, env: customEnv })
The docs are here and as far as I can tell, we'd need to pass detached: true
to specifically have that behaviour.
Are you able to test the changes to see if it helps? If not, are you able to leave a process around for a while to see if it does actually close? (for me it only took 5-10s but I don't know if this might also depend a little on exactly what the server was doing at the time it closed).
Also - are you able to get the full command line (from ps
?). I wonder if dartdev
is spawning the analysis server snapshot in another process (in which case there might be an additional layer of processes).
Edit: It does not add another process, it spawns the snapshot in an isolate.
from dart-code.
I just verified that v3.89.20240509
does fix the issue for me =)
It's weird. It's probably related to the fact the process is in a bad state taking up 100% of a core. When I have the engine open I'm not even editing dart files, so running analysis is pointless. Maybe that's related.
Anyway, thanks so much Danny (I'll let you close the issue, I'm not sure how you want to do your bookkeeping for things on prerelease).
from dart-code.
from dart-code.
@MickeyMouse623 please file a new issue for this. I see you have "41k" in your source control tab - have you opened a very large folder? The server will be busy while it tries to analyze whichever folder(s) you have open in the workspace.
from dart-code.
Related Issues (20)
- Sidebar doesn't work in web contexts because DTD URI is not exposed HOT 1
- The "Open Log" button on generic prompt to reload should be more targetted
- Auto imports broken on third party packages HOT 13
- m HOT 1
- m HOT 1
- Widget Inspector incompatible size in vscode HOT 1
- Triggererd breakpoints are not resetting on restart HOT 2
- [DevTools] Add toggle for showSemanticsDebugger HOT 1
- ... HOT 1
- The class cannot be opened using ctrl, and the class hierarchy cannot be displayed HOT 21
- Dependencies tree doesn't show correct nodes HOT 2
- I cannot run or debug normally on Vs code (flutter) HOT 1
- Make "Build errors exist in your project" clearer
- `@template` documents declared on extension aren't shown elsewhere HOT 3
- Manually restarting the analysis server whlie analysing shows that the server wont restart HOT 3
- analysis_options exclusions are applied incorrectly when detecting projects
- Nested packages in Dependencies tree are shown flattened but sorted by path HOT 1
- Expanding a project in Dependencies tree triggers a pub fetch which creates .dart_tool
- Color previews are missing on Flutter master HOT 2
- Closing labels (and others?) may not work with non-file-based documents (such as dart-macro+file)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart-code.