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
A replaced start attempt can still clear serverError and install its connection after initialize #1863
Since #1673 and #1827, a start() while a restart attempt initializes returns, and the start task stops a provider whose attempt a stop or a newer start replaced before the provider was made. One window is left: the stages of the start chain after initServer don't check that their attempt is still the current one:
the stage that sets serverError = null, serverCapabilities and the client features' capabilities;
the stage that sends initialized;
the stage that installs the attempt's lspStreamProvider, languageClient, languageServer and launcherFuture into the wrapper and calls updateStatus(ServerStatus.started).
stop() cancels only initializeFuture, the chain's last stage, the exceptionally one. So for an attempt that a stop, or a stop and a newer start, replaced after it sent initialize, these stages still run when its reply comes: the old attempt clears the error that the current attempt is restarting for, sets the capabilities from its own server, and installs its connection, whose provider stop() is shutting down, over the current one, with the status started.
We saw what the whole race does with 0.21.0. After a server's process was killed, eight processes started within 0.33 s; two of them initialized and served the project at once, the document's didOpen going to one and the feature requests for it to the other, and one was never stopped. main fixes the first two causes; this is what remains.
A proposal: a check, in stages 1 and 3 and under the wrapper's monitor for stage 3, that throws a CancellationException unless the attempt is still currentInitializingContext and the wrapper isn't disposed. The attempt's own exceptionally stage is cancelled already, so it reports nothing.
Seen in main (1988ab6c), with the Ecstasy language server (XVM).
Activity
Track UP72: a killed language server comes back as several
fix: close the gaps CodeRabbit found in #1864 and #1865 (#1867)
fix: ignore the initialize reply of a start attempt that a stop replaced
Track UP72: a killed language server comes back as several
Track UP72: a killed language server comes back as several
Track UP72: a killed language server comes back as several
Track UP72: a killed language server comes back as several
Track UP72: a killed language server comes back as several
Track UP72: a killed language server comes back as several
Track UP72: a killed language server comes back as several
Track UP72: a killed language server comes back as several
Track UP72: a killed language server comes back as several
Track UP72: a killed language server comes back as several