fix(http): drain SSE stream for connection reuse (#790)

* fix(http): reduce latency on subsequent StreamableHttp calls

* refactor: rely on stream drain for connection reuse

* refactor: clean up comments and naming

* fix: restore pool_max_idle_per_host(0) for Linux
This commit is contained in:
Dale Seo 2026-04-13 16:33:30 -04:00 • committed by GitHub
commit c99903a67a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -470,7 +470,7 @@ impl LocalSessionWorker {
{
OutboundChannel::RequestWise {
id: *id,
close: false,
close: true,
}
} else {
OutboundChannel::Common
@ -483,7 +483,7 @@ impl LocalSessionWorker {
{
OutboundChannel::RequestWise {
id: *id,
close: false,
close: true,
}
} else {
OutboundChannel::Common
@ -501,7 +501,11 @@ impl LocalSessionWorker {
if let Some(request_wise) = self.tx_router.get_mut(&id) {
request_wise.tx.send(message).await;
if close {
self.tx_router.remove(&id);
if let Some(channel) = self.tx_router.remove(&id) {
for resource in channel.resources {
self.resource_router.remove(&resource);
}
}
}
} else {
return Err(SessionError::ChannelClosed(Some(id)));