Skip to content

Fix multiple-initialization on crash recovery - Client creation needs refactoring #12105

@Colengms

Description

@Colengms

The process of creating client/languageClient objects when the extension initializes, or recovers from a crash, is not well managed/synchronized. There is a mixture of async code and sync code (that kicks off async code without waiting for it).

Currently, there is a bug where, if the process of recovering from a crash is interrupted with another crash (in the LSP initialization message) or a transient failure to execute the process, two crash recoveries will run simultaneously, resulting in multiple initializations of the same cpptools process.

Although we can move sync code out of constructors (for DefaultClient, etc.) and into async init functions fairly simply, so we can await stuff, that incurs possible deadlocks (perhaps in combination with the enqueue chain, which is client-specific), making this not a trivial fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServiceinternalUsed to opt-out an issue from having GitHub actions applied to it

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions