Repository navigation
Fix #55 frame drain; log dropped sidecar notifications; support languageclient 11 - #62
Merged
Merged
Conversation
added 2 commits
November 19, 2026 06:35
FrameTooLarge left the claimed body in the stream, so the next read parsed inside it and every consumer had to end the session. The body is now drained through a fixed-size buffer before the error returns. Tests: a refused frame followed by valid ones, and a 64 MiB + 1 discard staying under a 64 KiB allocation bound.
inbound: a full notification buffer now warns, with the drop total and capacity, each time the total reaches a power of two. The bound test asserts the exact drop count and the logged totals 1..64. lsp-profiler-ui: peer range adds ^11.0.0; dev deps move to vscode-languageclient/-languageserver 11, all UI suites green.
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.
TLDR
FrameTooLargenow discards the refused body, so a server can refuse one oversized message and keep reading the connection. Fixes #55. Also: dropped sidecar notifications are now logged, and@nimblesite/lsp-profiler-uiacceptsvscode-languageclient11 (both asked for by SharpLsp).Added
refuseincrates/lspkit-server/src/jsonrpc.rs: drains theclaimedbody bytes throughtokio::io::copyintotokio::io::sink()(fixed-size buffer, never allocated to the claim), then returnsFrameTooLarge; an I/O error while draining isFramingError::Io.lspkit::sidecar::inbound: when the notification buffer is full, atracing::warn!withdropped(running total) andcapacityfires each time the total reaches a power of two, so a flood logs O(log n) lines.tracingbecomes a normal dependency oflspkit;tracing-subscriberis a dev-dependency for the capture.Changed/Deleted
lsp-profiler-uipeer range^9.0.1 || ^10.1.0 || ^11.0.0; dev depsvscode-languageclient/vscode-languageserver^11.0.0,vscode-languageserver-textdocument^1.0.16.__pycache__/*.pycundercrates/lsp-profiler-python/tests/python/.read_message_withincallsrefuseinstead of returning before the body.FrameTooLargedocs: the connection stays usable.HeaderTooLargedocs: no frame boundary is known, so the connection cannot continue.oversized_content_length_is_rejected_without_allocating_the_claim(the body is now read, so "before any body is read" was false).How tests prove it
tests/jsonrpc.rs::a_refused_frame_leaves_the_stream_at_the_next_frame(red before the fix:BadHeader("missing")): with cap 4, frames of 8, 2, 5 and 44 bytes giveFrameTooLarge{8},BadJson(2-byte frame read whole),FrameTooLarge{5}, the decoded notification, thenClosed.tests/jsonrpc_frame_heap.rs(red before the fix:HeaderTooLarge): a 64 MiB + 1 frame followed by a valid one allocates < 64 KiB under the instrumented allocator, returnsFrameTooLarge, then decodes the next message.lspkit/tests/sidecar_notification_bound.rs::unread_notifications_stay_bounded_and_every_drop_is_reported(red before the fix: no WARN events): 1024 + 64 notifications leave exactly 1024 queued,dropped_notifications == 64, and the JSON log has WARN events withdropped1, 2, 4, 8, 16, 32, 64 andcapacity1024.make cigreen locally (before the second commit; lint and the touched suites rerun after).Spec/doc changes
[JSONRPC-FRAME-LIMIT]indocs/specs/lspkit-spec.md: oversized bodies are discarded, never allocated, and the connection continues; afterHeaderTooLargeit cannot.Breaking changes
None. Behaviour only: the reader advances past a refused frame.
🤖 Generated with Claude Code