Repository navigation
Conversation
The signal is a minimal stage, whose cancel throws: Reactor cancelled it when the exchange won the race against it, and dropped an UnsupportedOperationException on every request. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Jerome Louvel <374450+jlouvel@users.noreply.github.com>
jlouvel
commented
Nov 29, 2026
jlouvel
left a comment
Collaborator
Author
There was a problem hiding this comment.
Verified: the fix is correct and covers the whole repository.
minimalCompletionStage().toCompletableFuture()returns a new, independent CompletableFuture (it does not throw, unlikecancelon the minimal stage). It is linked to the source by a relay, so it completes with the cause when the request disconnects, and a copy taken after the disconnect is already completed. The supplier overload ofMono.fromCompletionStagetakes the copy at subscription time, so a late subscription is covered too.- Cancelling the copy only cancels the copy: the relay does not propagate back, so the request's own signal is never completed or cancelled (the same property
RequestLifecycleTestCasealready relies on fornew Request(request)). - The other
getDisconnectSignal()uses (RestletClientStream,RestletServerHost,SmithyServerHost,NettyClientHelper,McpLegacySessionHostin tests) only callthenAccept, never wrap the stage in a Mono, so none of them can cancel it. The two MCP call sites are the only ones to fix. - The
changes.mdentry is in the right section (first version, Bugs fixed) and follows the style.
Two optional points inline.
Review assisted by Claude Code.
…rror filter (#1764) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Jerome Louvel <374450+jlouvel@users.noreply.github.com>
jlouvel
commented
Nov 29, 2026
jlouvel
left a comment
Collaborator
Author
There was a problem hiding this comment.
Re-review of a3c1965: clean, no new findings.
- The mono is built from the copy returned by toCompletableFuture() on the minimal stage, so Reactor's cancel acts on the copy and no longer reaches the throwing stage; the supplier form defers it to subscription, and the other getDisconnectSignal callers in the repository only chain thenAccept and never cancel.
- McpDisconnectedTestCase is meaningful: it checks that the cause reaches an early and a late subscriber, and that cancelling leaves the request's own signal incomplete.
- Both regression tests now record only UnsupportedOperationException in the global hook and reset it in a finally block.
Review assisted by Claude Code.
|
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.



Fixes #1764.
Every request the MCP adapter serves logged an
ERRORfrom Reactor,Operator called default onErrorDropped, with anUnsupportedOperationException.Request.getDisconnectSignal()returns a minimal stage, whosecancelthrows;McpServerAdapter.admitandMcpModernExchangeturned it into aMonowithMono.fromCompletionStageand raced it against the exchange, so when the exchange won, Reactor cancelled the stage.McpMessages.disconnected(Request)builds theMonofromrequest.getDisconnectSignal().toCompletableFuture(), a copy that can be cancelled and does not complete the signal. Both call sites use it.admitand the modern exchange) installHooks.onErrorDroppedand assert nothing is dropped after a served request; both fail without the fix with theUnsupportedOperationException.changes.mdentry under "Bugs fixed".All 243 tests of
org.restlet.ext.mcppass andspotless:checkis clean.🤖 Generated with Claude Code