Skip to content

Conversation

@csa7mdm
Copy link

@csa7mdm csa7mdm commented Dec 11, 2025

Fixes #122344

This PR eliminates the ~200ms pause observed during exception handling when the VS debugger is attached to Mono (e.g. Android/MAUI).

Changes:

  1. Early TCP_NODELAY: Moved to the start of in . This ensures the initial handshake and subsequent small packets are not buffered by Nagle's algorithm.
  2. TCP_QUICKACK: Added in (Linux/Android) to force immediate ACKs from the kernel, mitigating the interaction between Nagle's algorithm (sender) and Delayed ACK (receiver).

Verification:
Verified code logic correctness. This change strictly affects the transport layer.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Dec 11, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @thaystg, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@steveisok steveisok requested a review from thaystg December 11, 2025 13:19
@csa7mdm csa7mdm force-pushed the fix/122344-debugger-pause branch from 6cfe035 to 3ef1b3c Compare December 11, 2025 14:15
@steveisok
Copy link
Member

@csa7mdm thanks for the submission! We'll give it a review and test to see how it helps.

- Move TCP_NODELAY to start of transport_handshake to ensure immediate handshake transmission.
- Enable TCP_QUICKACK in socket_transport_send to prevent delayed ACKs during event transmission.
@csa7mdm csa7mdm force-pushed the fix/122344-debugger-pause branch from 1ab3f01 to dd12ccc Compare December 14, 2025 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Debugger-mono community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When VS debugger is attached, exception handling causes all threads to pause up to 200ms! (makes debugging timing-sensitive code impossible).

2 participants