Prune idle sessions before starting new ones (#701)

This commit is contained in:
Stephen Halter 2025-08-18 11:04:27 -07:00 • committed by GitHub
commit b067261ca7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 472 additions and 281 deletions

View file

@ -193,6 +193,8 @@ internal sealed partial class SseClientSessionTransport : TransportBase
return;
}
LogTransportReceivedMessageSensitive(Name, data);
try
{
var message = JsonSerializer.Deserialize(data, McpJsonUtilities.JsonContext.Default.JsonRpcMessage);

View file

@ -211,6 +211,8 @@ internal sealed partial class StreamableHttpClientSessionTransport : TransportBa
private async Task<JsonRpcMessageWithId?> ProcessMessageAsync(string data, JsonRpcRequest? relatedRpcRequest, CancellationToken cancellationToken)
{
LogTransportReceivedMessageSensitive(Name, data);
try
{
var message = JsonSerializer.Deserialize(data, McpJsonUtilities.JsonContext.Default.JsonRpcMessage);