Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Server remains open for requests after unhandled "noncritical" exceptions #448

Description

https://github.com/Microsoft/python-language-server/blob/4a00ee80cb2d7b3e736329e82b2ed441ae70b5ca/src/Analysis/Engine/Impl/Intellisense/AnalysisQueue.cs#L60-L71

When an unhandled exception occurs, and it's deemed "noncritical", the error is logged and then the AnalysisQueue gets disposed. However, the users of the queue have no idea this is happening and will continue to use it. Specifically, the language server will get requests which only lead to ObjectDisposedException.

I'm not sure what the correct behavior is here, but if an exception occurs and we are choosing to dispose of the queue, then I feel like either a new queue needs to be created or the server needs to shut down.

#446 related.

Activity

  1. jakebailey commented on Dec 3, 2018

    @jakebailey
    MemberAuthor

    The IsCriticalException call is also strange, since it's defined as:

    https://github.com/Microsoft/python-language-server/blob/69a34ca3c515b310c41b78ae7aeb30da25a68bef/src/Analysis/Engine/Impl/Infrastructure/Extensions/ExceptionExtensions.cs#L25-L30

    I almost feel like all exceptions other than a cancellation should be rethrown. And, if we're even able to catch any of these "critical" exceptions, there's no reason to not at least make an attempt to record something. Special casing a list of essentially uncatchable exceptions to choose to not catch seems strange.

  2. MikhailArkhipov commented on Dec 5, 2018

    @MikhailArkhipov

    IsCritical means unable to recover, even unable to send telemetry or write logs, i.e. unconditional shutdown.

  3. MikhailArkhipov commented on Dec 19, 2018

    @MikhailArkhipov

    We should report exception through telemetry and re-throw, letting process crash so it can be orderly restarted by the client. Otherwise client will be talking to the dead server.

  4. MikhailArkhipov commented on Dec 19, 2018

    @MikhailArkhipov

    Most probably will fix #452 and friends

  5. jakebailey commented on Dec 22, 2018

    @jakebailey
    MemberAuthor

    Fixed in #498.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions