Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] defer initialization until event loop is available #852

Closed

Conversation

bollwyvl
Copy link
Collaborator

@bollwyvl bollwyvl commented Sep 12, 2022

References

Code changes

  • moves full initialization off critical path to starting JupyterServerApp
    • when it does initialize, moves potentially-expensive actions to a thread pool executor to not inadvertently block other early functions
    • when done, set a ready flag
  • makes more of the handler methods asynchronous, and wait on the ready flag

User-facing changes

  • slow startup would now be deferred, allowing the server to start more quickly
  • the initial request for language status might be delayed some
    • typically it takes a while and many hundreds of HTTP requests, to get all the way up to a full-rendered document that could even request whether a language server is available
  • the debug log message comes after the server announces its location, making it harder to find the server URL

Backwards-incompatible changes

  • n/a, though some of the internal methods

Future Work

  • this is still "blocks" (from an information theory perspective) the ability to start any session until all servers are discovered
    • theoretically with an isComplete flag on the response, we could handle partial setup better, and hoist more errors to the client log

Chores

  • linted
  • tested
    • the new server initialize code isn't under unit test, probably should be
    • benchmark startup somehow?
  • documented
  • changelog entry

@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch bollwyvl/jupyterlab-lsp/gh-851-lazy-initialization

@bollwyvl
Copy link
Collaborator Author

Continued in #882

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant