Repository navigation
Honor synchronous startup timeouts and clean up failed initialization - #163
Merged
Merged
Conversation
LakshyAAAgrawalP
approved these changes
Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Synchronous startup ignored the configured timeout and left its background thread and subprocess running when initialization failed. Apply the timeout to initialization, await cancellation and process cleanup before returning the error, and always stop the thread and close its event loop.
Validation: four regression cases failed on main; all four pass after the fix. Tests launch real subprocesses and check cancellation, process termination, thread exit, and loop closure after timeout, initialization error, normal exit, and a caller exception. Real Jedi completions, synchronous Black integration, and the existing request-timeout test also pass (8 tests total).
Startup timeouts raise built-in
TimeoutErrorconsistently, including Python 3.10 whereasyncio.TimeoutErroris a separate class. The four startup regressions and existing request-timeout test also pass on Python 3.10.The timeout limits initialization; resource cleanup completes before the exception is returned. It does not add a shutdown deadline.