Conversation
- Fix taplo formatting by aligning dependency keys in xtask/Cargo.toml - Gate UnixStream and related imports/functions with #[cfg(unix)] to fix Windows compilation - Use inline format args in bail! macro to satisfy clippy Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
juleswritescode
left a comment
There was a problem hiding this comment.
only one major concern: socket timeouts in longer-running cli integration tests
- Make REQUEST_TIMEOUT configurable via open_with_timeout() instead of #[cfg(test)] hack - Check that `leaks` tool is installed before running probes - Replace custom json_escape with serde_json::json! macro - Use 2ms timeout in leak-check xtask (no point waiting on a dropped stream) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
juleswritescode
approved these changes
Feb 27, 2026
| } | ||
|
|
||
| fn send_lsp_message(stdin: &mut ChildStdin, payload: &str) -> anyhow::Result<()> { | ||
| fn send_lsp_json(stdin: &mut ChildStdin, value: Value) -> anyhow::Result<()> { |
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.
Summary
Fixes retained-memory growth in
SocketTransport::requestby ensuring pending request entries are removed on all error paths (serialization/send/channel-close/timeout), and by only inserting entries after successful request serialization.This PR also adds a reusable leak-check workflow via
xtask:--probe lsp: macOSleakscheck for LSP open/change/close churn--probe cli-timeout: retained-memory growth probe for timeout/channel-close scenarios--probe both: runs both probes sequentiallyLeak root cause
pending_requestsentries were inserted before serialization/send/wait finished and were not always removed when requests failed early. Repeated failing requests caused unbounded map growth and RSS growth.Why this fixes it
pending_requestspending_requestsbefore returningTest plan
request_does_not_retain_pending_entries_when_serialization_failsrequest_does_not_retain_pending_entries_on_timeout_or_channel_closecargo test -p pgls_cli request_does_not_retain_pending_entries_when_serialization_failscargo test -p pgls_cli request_does_not_retain_pending_entries_on_timeout_or_channel_closecargo run -p xtask -- leak-check --probe cli-timeout --iterations 200000cargo run -p xtask -- leak-check --probe lsp --iterations 20000 --pause-ms 1