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
fix: don't send log notification on transport error
When a transport yields an Exception into the server's read stream
(e.g., POST handler catches an error, or JSON parsing fails), the
server was attempting to send a notifications/message back to the
client. This raced with the write stream being closed during session
teardown, raising ClosedResourceError inside the handler's TaskGroup
and crashing the session.
The transport that just reported an error is typically broken or
about to close. In the streamable HTTP case, the client has already
received an HTTP 500 before the Exception is even yielded. The
TypeScript, Go, and C# SDKs all handle transport errors by logging
locally only, never writing back through the transport.
This removes the send_log_message call added in #786, keeping the
local logger.error and the raise_exceptions re-raise. A new
integration test with real memory streams (no mocks, no sleeps)
deterministically reproduces the exact #1967 stack trace on the old
code and passes on the new code.
Fixes#1967Fixes#2064
Reported-by: jonfinerty
Reported-by: einarfd
Github-Issue: #1967
Github-Issue: #2064
0 commit comments