Skip to content

add timeout guard for nimsuggest startup#411

Open
ZoomRmc wants to merge 1 commit into
nim-lang:masterfrom
ZoomRmc:znimsuggesttimeout
Open

add timeout guard for nimsuggest startup#411
ZoomRmc wants to merge 1 commit into
nim-lang:masterfrom
ZoomRmc:znimsuggesttimeout

Conversation

@ZoomRmc
Copy link
Copy Markdown

@ZoomRmc ZoomRmc commented May 15, 2026

createOrRestartNimsuggest blocks on waitFor(createNimsuggest(...)) which can hang indefinitely if nimsuggest fails to start or becomes unresponsive. This blocks tool calls and the MCP client eventually times out after 30 seconds, wasting time on every failure.

Fix: wrap the createNimsuggest call in utils.withTimeout with a configurable NIMSUGGEST_STARTUP_TIMEOUT of 30 seconds. On timeout, the nimsuggest future is cancelled and the proc returns early with an error log instead of blocking the caller.

createOrRestartNimsuggest blocks on waitFor(createNimsuggest(...))
which can hang indefinitely if nimsuggest fails to start or becomes
unresponsive. This blocks tool calls and the MCP client eventually
times out after 30 seconds, wasting time on every failure.

Fix: wrap the createNimsuggest call in utils.withTimeout with a
configurable NIMSUGGEST_STARTUP_TIMEOUT of 30 seconds. On timeout,
the nimsuggest future is cancelled and the proc returns early with
an error log instead of blocking the caller.
@ZoomRmc ZoomRmc changed the title Znimsuggesttimeout add timeout guard for nimsuggest startup May 15, 2026
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.

1 participant