Skip to content

Honor synchronous startup timeouts and clean up failed initialization - #163

Merged
LakshyAAAgrawalP merged 2 commits into
mainfrom
fix/sync-startup-timeout
Oct 12, 2026
Merged

LakshyAAAgrawalP merged 2 commits into
mainfrom
fix/sync-startup-timeout

Conversation

@LakshyAAAgrawal

@LakshyAAAgrawal Lakshya A Agrawal (LakshyAAAgrawal) commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

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 TimeoutError consistently, including Python 3.10 where asyncio.TimeoutError is 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.

@LakshyAAAgrawalP
LakshyAAAgrawalP merged commit ef16b80 into main Oct 12, 2026
6 checks passed
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.

2 participants