You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP: cancelling the disconnect signal logs an UnsupportedOperationException on every request #1764
Follow-up to #1700. Found while moving an MCP server onto org.restlet.ext.mcp (naftiko/ikanos#838).
Every request the MCP adapter serves logs an ERROR from Reactor, Operator called default onErrorDropped, with an UnsupportedOperationException:
java.lang.UnsupportedOperationException: null
at java.base/java.util.concurrent.CompletableFuture$MinimalStage.cancel(CompletableFuture.java:2989)
at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.cancel(MonoCompletionStage.java:156)
at reactor.core.publisher.FluxFirstWithSignal$RaceCoordinator.tryWin(FluxFirstWithSignal.java:275)
...
at org.restlet.ext.mcp.internal.McpWorkers.work(McpWorkers.java:145)
Nothing fails, and the response is right, but the log is wrong. It shows 40 times in the HTTP tests of one module, and on the stdio transport it puts a stack trace on stderr for most requests, which is what many clients show to their users.
Cause:Request.getDisconnectSignal() returns disconnectSignal.minimalCompletionStage(), a CompletableFuture subclass whose cancel throws. McpServerAdapter.admit and McpModernExchange turn it into a Mono with Mono.fromCompletionStage(...) and race it against the exchange with Mono.firstWithSignal. When the exchange wins, the race cancels the loser, and MonoCompletionStage calls cancel on the minimal stage.
Delivery:
Subscribe to the disconnect signal without cancelling it: build the Mono from stage.toCompletableFuture() (a copy, which can be cancelled), through one small helper that both call sites use.
A test that serves a request and asserts nothing reaches Reactor's onErrorDropped hook (Hooks.onErrorDropped), over the modern HTTP path and the stdio one.
Activity
Test the disconnect signal of an MCP request and narrow the dropped-e…
Read the disconnect signal of an MCP request through a copy (#1764)
Test the disconnect signal of an MCP request and narrow the dropped-e…
Resolve the changes.md entries of #1764 and #1765 after the rebase
Read the disconnect signal of an MCP request through a copy (#1764)
Test the disconnect signal of an MCP request and narrow the dropped-e…
Resolve the changes.md entries of #1764 and #1765 after the rebase
jlouvel commentedon Nov 30, 2026
Delivered by #1766 (merged to 3.0). Closing by hand because 3.0 merges don't auto-close.