Skip to content

fix(lsp): await background init task on shutdown#203

Open
ebbsanchez wants to merge 1 commit into
bug-ops:mainfrom
ebbsanchez:fix/background-lsp-shutdown
Open

fix(lsp): await background init task on shutdown#203
ebbsanchez wants to merge 1 commit into
bug-ops:mainfrom
ebbsanchez:fix/background-lsp-shutdown

Conversation

@ebbsanchez

Copy link
Copy Markdown

Description

Fixes the shutdown path introduced by non-blocking LSP startup by keeping the background initialization task handle and awaiting it with a bounded timeout after cancellation is sent.

This keeps serve_with non-blocking during startup, but makes shutdown observe the background task instead of dropping the JoinHandle. If the task panics, it is now logged; if it does not stop promptly, shutdown logs a timeout and continues.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)

Related Issues

Fixes #196

Checklist

  • I have read the CONTRIBUTING guide
  • My code follows the project's coding style
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass
  • I have updated the documentation accordingly
  • I have updated the CHANGELOG.md (for user-facing changes)

Verification

  • cargo +nightly fmt --check
  • cargo test -p mcpls-core graceful_degradation_tests -- --nocapture
  • cargo clippy -p mcpls-core --all-targets --all-features -- -D warnings

Additional Notes

I did not update CHANGELOG.md because this is an internal shutdown/diagnostic behavior fix without a user-facing CLI/API change.

@github-actions github-actions Bot added rust Rust code changes mcpls-core mcpls-core crate changes labels Jul 4, 2026
@ebbsanchez

ebbsanchez commented Jul 4, 2026

Copy link
Copy Markdown
Author

CI note: I checked the current failures. The CodeQL jobs fail before analyzing this patch because the pull_request_target workflow's actions/checkout@v7 step refuses to checkout fork PR code with allow-unsafe-pr-checkout: false. The regular CI run is marked action_required, which looks like the usual maintainer approval gate for fork PRs.

Local verification for the patch is still:

  • cargo +nightly fmt --check
  • cargo test -p mcpls-core graceful_degradation_tests -- --nocapture
  • cargo clippy -p mcpls-core --all-targets --all-features -- -D warnings

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

Labels

mcpls-core mcpls-core crate changes rust Rust code changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lsp: await background init task on shutdown to surface panics and drain pump tasks

2 participants