Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: modelcontextprotocol/csharp-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.4.0
Choose a base ref
...
head repository: modelcontextprotocol/csharp-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.4.1
Choose a head ref
  • 5 commits
  • 4 files changed
  • 3 contributors

Commits on Jun 5, 2026

  1. Release SSE response stream reference when GET request ends

    StreamableHttpServerTransport held a reference to the Kestrel SSE
    response stream via _httpSseWriter for the entire session lifetime.
    Since the transport is only disposed when the session itself is disposed
    (via explicit DELETE or idle timeout), clients that disconnect without
    sending DELETE — which is typical for long-lived SSE connections — left
    the response stream pinned for the remainder of the idle timeout window.
    
    Because the Kestrel HTTP connection (and its associated memory pool
    buffers, Pipe readers/writers, socket send/receive buffers) is only
    collectible once all references to the response stream are released,
    this pinned ~20MiB of unmanaged memory per disconnected session until
    cleanup. Under steady connect/disconnect churn (e.g., IDE availability
    probes) this accumulated into sustained memory growth that eventually
    OOMKilled the container.
    
    Fix: release _httpSseWriter from within HandleGetRequestAsync's finally
    block so the reference is dropped as soon as the GET request exits, not
    just when the session is disposed. SendMessageAsync handles the
    now-nullable field via the existing _getHttpResponseCompleted gate, and
    any server-to-client messages sent after disconnect are still captured
    by the event store writer for replay via Last-Event-ID.
    
    Add a unit test that verifies _httpSseWriter is null once
    HandleGetRequestAsync returns.
    
    Relates to #766.
    joelmforsyth authored and halter73 committed Jun 5, 2026
    Configuration menu
    Copy the full SHA
    4d01199 View commit details
    Browse the repository at this point in the history
  2. Apply review feedback: replace _getHttpResponseCompleted with _dispos…

    …ed; rewrite test
    
    - Remove _getHttpResponseCompleted and rely on _httpSseWriter being null as the signal that the GET response stream has been released. Null out _httpSseWriter in DisposeAsync so SendMessageAsync correctly skips writing post-dispose.
    - Replace the dispose-idempotency role of the old flag with a dedicated _disposed bool.
    - Move the explanatory comment in SendMessageAsync onto the event store branch (which intentionally still runs when the response stream is gone, to support Last-Event-ID replay).
    - Rewrite the unit test to assert observable behavior via a recording Stream instead of reflecting on private fields.
    
    Co-authored-by: Copilot <[email protected]>
    Copilot authored and halter73 committed Jun 5, 2026
    Configuration menu
    Copy the full SHA
    25f0801 View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2026

  1. Configuration menu
    Copy the full SHA
    0021d88 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2026

  1. Prepare release v1.4.1

    - Bump version from 1.4.0 to 1.4.1
    - Add release-notes link to src/PACKAGE.md
    
    Co-authored-by: Copilot <[email protected]>
    jeffhandley and Copilot committed Jul 8, 2026
    Configuration menu
    Copy the full SHA
    b088dd3 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2026

  1. Release v1.4.1 (#1694)

    jeffhandley authored Jul 9, 2026
    Configuration menu
    Copy the full SHA
    2b7fd35 View commit details
    Browse the repository at this point in the history
Loading