dlang-community / DCD

The D Completion Daemon is an auto-complete program for the D programming language
GNU General Public License v3.0
349 stars 71 forks source link

DCD Server keeps running in the background with 30% CPU load, seemingly doing nothing #633

Closed Rojetto closed 3 years ago

Rojetto commented 3 years ago

This happens with version 0.13.1, both using the D plugins for Visual Studio Code and Intellij. I'm only using the editor frontends, so I unfortunately don't even know where to start looking for the problem. I'd be happy to provide more specific info if you tell me what you need.

Rojetto commented 3 years ago

Thanks for the suggestion. I just switched, but it only made things worse. The extension automatically installed DCD Server version 0.13.2. When opening my project I now get an error every few seconds saying „Could not initialize DCD for “. Here's what's in the log (it just keeps filling up like that)

serve-d v0.7.0-beta.5 with workspace-d v3.5.0
Included features: "d", "workspaces"
Built: Mon Apr 12 02:43:46 2021
with compiler LDC v2.95 on win64 littleEndian
dub, dfmt and dscanner are bundled within (compiled in)
2021-04-12T18:44:34.715 [info] C:\Users\runneradmin\AppData\Local\dub\packages\workspace-d-3.6.0-pre.11\workspace-d\source\workspaced\com\dcd.d:80:reloadBinaries using builtin DCD client
2021-04-12T18:44:34.753 [info] source\served\extension.d:646:rootsForProject Root Suggestions: [RootSuggestion("c:\\dev\\ReNEO", true)]
2021-04-12T18:44:34.754 [info] source\served\extension.d:678:doStartup registering instance for root RootSuggestion("c:\\dev\\ReNEO", true)
2021-04-12T18:44:34.885 [info] source\served\extension.d:766:delayedProjectActivation Initializing instance for root RootSuggestion("c:\\dev\\ReNEO", true)
2021-04-12T18:44:35.079 [info] source\served\extension.d:837:delayedProjectActivation Root RootSuggestion("c:\\dev\\ReNEO", true) initialized in 193 ms, 366 μs, and 8 hnsecs
2021-04-12T18:44:39.434 [info] C:\Users\runneradmin\AppData\Local\dub\packages\workspace-d-3.6.0-pre.11\workspace-d\source\workspaced\com\dcd.d:221:__lambda5 DCD-Server stopped with code 1
2021-04-12T18:44:39.434 [info] C:\Users\runneradmin\AppData\Local\dub\packages\workspace-d-3.6.0-pre.11\workspace-d\source\workspaced\com\dcd.d:224:__lambda5 Broadcasting dcd server crash.
2021-04-12T18:44:41.358 [error] lsp\source\served\lsp\jsonrpc.d:367:showErrorMessage Error message:  Could not initialize DCD for c:\dev\ReNEO.
2021-04-12T18:44:41.359 [error] source\served\extension.d:916:startDCDServer std.socket.SocketOSException@std\socket.d(2857): Unable to connect socket: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte.
----------------
0x00007FF6C62921AD
0x00007FF6C6291F16
0x00007FF6C628F07C
0x00007FF6C6267B4A
0x00007FF6C62507C6
0x00007FF6C620B4A1
0x00007FF6C620B5F7
0x00007FF6C620BEB2
0x00007FF6C5F0FEC4
0x00007FF6C5F0FD5F
0x00007FF6C5E05523
0x00007FF6C5E06517
0x00007FF6C5E20487
0x00007FF6C5E1FE2E
0x00007FF6C5E06120
0x00007FF6C5DCB6EC
0x00007FF6C5DCB221
0x00007FF6C5DCB403
0x00007FF6C5DC856A
0x00007FF6C5DC0647
0x00007FF6C5DC16D2
0x00007FF6C6276978
0x00007FF6C6276F29
2021-04-12T18:44:47.696 [info] C:\Users\runneradmin\AppData\Local\dub\packages\workspace-d-3.6.0-pre.11\workspace-d\source\workspaced\com\dcd.d:221:__lambda5 DCD-Server stopped with code 1
2021-04-12T18:44:47.696 [info] C:\Users\runneradmin\AppData\Local\dub\packages\workspace-d-3.6.0-pre.11\workspace-d\source\workspaced\com\dcd.d:224:__lambda5 Broadcasting dcd server crash.
2021-04-12T18:44:49.615 [error] lsp\source\served\lsp\jsonrpc.d:367:showErrorMessage Error message:  Could not initialize DCD for c:\dev\ReNEO.
2021-04-12T18:44:49.616 [error] source\served\extension.d:916:startDCDServer std.socket.SocketOSException@std\socket.d(2857): Unable to connect socket: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte.

The project is open source, you're welcome to to try it out yourself here.

Rojetto commented 3 years ago

Using the workaround you proposed it now works. The weird CPU load is gone, and it also doesn't seem to randomly crash anymore, as it did on stable.

Thanks for investigating this, I would consider this resolved from my side!

aminya commented 3 years ago

I opened a separate issue for the broken binaries #635