vscode-coding-tracker icon indicating copy to clipboard operation
vscode-coding-tracker copied to clipboard

Race condition when opening multiple windows

Open atombender opened this issue 6 years ago • 2 comments

If you run multiple VSCode windows, this extension seems to sometimes want to start multiple servers:

[LocalMode]: try to kill old tracking server...
[LocalMode]: there are no old tracking server, just opening a new local server...
[Launch]: Local server launching...
[Launched]: Local server has launching!
15:42:41 Debug mode be turned on!

[Error]: events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE 127.0.0.1:10345
    at Server.setupListenHandle [as _listen2] (net.js:1286:14)
    at listenInCluster (net.js:1334:12)
    at doListen (net.js:1460:7)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
    at startup (internal/bootstrap/node.js:279:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:752:3)
Emitted 'error' event at:
    at emitErrorNT (net.js:1313:8)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    [... lines matching original stack trace ...]
    at bootstrapNodeJSCore (internal/bootstrap/node.js:752:3)

[Error]: local server exit with code 1!(have you launch another local sever?)
[Exit] exit code: 1

It should detect EADDRINUSE as a non-error, since it means the server is already running, or somehow keep better track of the background process. In my case, it happens pretty consistently when starting up VSCode (as it restores the windows I previously had open).

atombender avatar Jan 22 '19 20:01 atombender

Yes, I met this bug. I will fix some bug and improve it in the end of this month

hangxingliu avatar Jan 23 '19 14:01 hangxingliu

Same here with a duplicate workspace (since the other window is independent). Now it made sense why it appears i had coded so little... lol

Is there an ID to each window? This could be used just like computer ID already is

bernardoadc avatar Oct 22 '19 14:10 bernardoadc