Repository navigation
[Server] Drop pending client requests of a vanished stream - #596
Open
chr-hertel wants to merge 9 commits into
Open
chr-hertel wants to merge 9 commits into
chr-hertel wants to merge 9 commits into
Conversation
…d not store on a fiber yield
chr-hertel
requested review from
CodeWithKyrian,
Nyholm and
soyuka
as code owners
October 13, 2026 23:34
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A stale session snapshot can leave an abandoned request’s concurrently stored response orphaned.
1 open finding
What changed in this PR
Adds cleanup for abandoned client requests and incorporates the prerequisite UUID-based request isolation work from #581.
Changes:
- Drops timed-out requests and stored answers after a grace period.
- Uses UUID request IDs and per-transport outgoing queues.
- Updates transports, tests, fixtures, and changelog documentation.
| File | Description |
|---|---|
src/Server/Protocol.php |
Implements UUID IDs, stream-specific queues, and abandoned-request cleanup. |
src/Server/Transport/TransportInterface.php |
Updates callback types for UUID request IDs. |
src/Server/Transport/BaseTransport.php |
Accepts UUIDs when finding responses. |
src/Server/Transport/ManagesTransportCallbacks.php |
Updates callback type declarations. |
src/Server/Transport/StreamableHttpTransport.php |
Converts pending IDs to UUIDs. |
src/Server/Transport/StdioTransport.php |
Converts pending IDs to UUIDs. |
tests/Unit/Fixtures/PollingLoopTransport.php |
Supports UUID IDs and captured outgoing messages. |
tests/Unit/Server/ProtocolTest.php |
Covers request isolation, cleanup, and UUID behavior. |
tests/Unit/Server/ProtocolSessionRaceTest.php |
Updates concurrency tests for UUID IDs. |
tests/Unit/Server/Transport/StdioSuspendedFibersTest.php |
Dynamically answers UUID-based requests. |
tests/Unit/Server/Transport/StreamableHttpTransportTest.php |
Updates pending-request fixtures for UUIDs. |
CHANGELOG.md |
Documents cleanup and UUID API changes. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
chr-hertel
force-pushed
the
fix-abandoned-pending-requests
branch
from
October 13, 2026 23:45
551c299 to
fae8cb9
Compare
This branch has not been deployed
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.

Stacked on #581 - merge after it, only the last two commits belong here.
Only the stream that sent a client request clears its pending entry. A stream that is gone, through a client disconnect or a dead worker, leaves the entry and any late answer in the session until it expires.
forget(), so it stays compatible with the per-key session savesFixes chr-hertel#84
🤖 Generated with Claude Code