fix: end existing clients on new start and properly await stop#264
Merged
brandonspark merged 2 commits intodevelopfrom Sep 2, 2025
Merged
fix: end existing clients on new start and properly await stop#264brandonspark merged 2 commits intodevelopfrom
brandonspark merged 2 commits intodevelopfrom
Conversation
Friss
approved these changes
Sep 2, 2025
Friss
left a comment
There was a problem hiding this comment.
I was just looking at the code to see if this stop needed an await.
semgrep-ci bot
pushed a commit
to semgrep/semgrep
that referenced
this pull request
Sep 2, 2025
This PR changes all our current usages of Lwt (in the LSP) to Eio. Changes include: 1. Using the Eio otel collector instead of the Lwt otel collector 2. Stop using preemptive threads 3. Using Eio instead of Lwt to send metrics As a side effect, this also fixes the process leak issue in the IDE caused by processes not terminating properly for users using experimental LS. ## Test plan: CI and tested with [this PR](semgrep/semgrep-vscode#264) to the `semgrep-vscode` repo. The video below shows: 1. No process leak when switching workspace folders 2. No process leak when restarting the server https://www.loom.com/share/052ff2e037ec49f6ac113b2c1741dc07 Traces are also sent properly: https://app.datadoghq.com/apm/trace/bfa65e995e7f6acb80bca8c20b6fbbab?graphType=waterfall&shouldShowLegend=true&spanID=5188063030673080386&traceQuery= synced from Pro 36ebf21debb09562c6dc6f05ed83a16f9a895f0c
semgrep-ci bot
pushed a commit
to semgrep/semgrep
that referenced
this pull request
Sep 3, 2025
This PR changes all our current usages of Lwt (in the LSP) to Eio. Changes include: 1. Using the Eio otel collector instead of the Lwt otel collector 2. Stop using preemptive threads 3. Using Eio instead of Lwt to send metrics As a side effect, this also fixes the process leak issue in the IDE caused by processes not terminating properly for users using experimental LS. ## Test plan: CI and tested with [this PR](semgrep/semgrep-vscode#264) to the `semgrep-vscode` repo. The video below shows: 1. No process leak when switching workspace folders 2. No process leak when restarting the server https://www.loom.com/share/052ff2e037ec49f6ac113b2c1741dc07 Traces are also sent properly: https://app.datadoghq.com/apm/trace/bfa65e995e7f6acb80bca8c20b6fbbab?graphType=waterfall&shouldShowLegend=true&spanID=5188063030673080386&traceQuery= synced from Pro 36ebf21debb09562c6dc6f05ed83a16f9a895f0c
nmote
pushed a commit
to semgrep/semgrep
that referenced
this pull request
Sep 3, 2025
This PR changes all our current usages of Lwt (in the LSP) to Eio. Changes include: 1. Using the Eio otel collector instead of the Lwt otel collector 2. Stop using preemptive threads 3. Using Eio instead of Lwt to send metrics As a side effect, this also fixes the process leak issue in the IDE caused by processes not terminating properly for users using experimental LS. ## Test plan: CI and tested with [this PR](semgrep/semgrep-vscode#264) to the `semgrep-vscode` repo. The video below shows: 1. No process leak when switching workspace folders 2. No process leak when restarting the server https://www.loom.com/share/052ff2e037ec49f6ac113b2c1741dc07 Traces are also sent properly: https://app.datadoghq.com/apm/trace/bfa65e995e7f6acb80bca8c20b6fbbab?graphType=waterfall&shouldShowLegend=true&spanID=5188063030673080386&traceQuery= synced from Pro 36ebf21debb09562c6dc6f05ed83a16f9a895f0c
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.
This PR makes it so:
.stop()the old one. Otherwise, we overwrite it and never can access its value again.awaitthe.stop()method.Test plan:
Verified that processes do not pile up on workspace change. Remains to be seen for
restart.PR checklist:
If you're unsure about any of this, please see: