Skip to content

Revert WebSocket Close issue#5940

Open
afifi-ins wants to merge 2 commits into
dotnet:mainfrom
afifi-ins:revert-websocket-issue-5818
Open

Revert WebSocket Close issue#5940
afifi-ins wants to merge 2 commits into
dotnet:mainfrom
afifi-ins:revert-websocket-issue-5818

Conversation

@afifi-ins
Copy link
Copy Markdown
Contributor

Issue: #5818

afifi-ins added a commit to afifi-ins/wcf that referenced this pull request May 20, 2026
The integration test suite calls Close() unconditionally after PR dotnet#5940
(revert of WebSocket close workaround). On resource-constrained Helix
Linux Open queues (2-4 vCPU), running tests at default parallelism can
starve the SelfHosted(Core)WCF service and cause WebSocket close
handshakes to time out, matching the failure pattern in issue dotnet#5819.

Add a global default to Directory.Build.props that caps -maxthreads at
min(ProcessorCount, 4) for any project with IsTestProject=true. This:
  - Resolves to '-maxthreads 2' on 2-vCPU Helix VMs (Linux Open queues)
  - Resolves to '-maxthreads 4' on 16-core dev boxes (preserves throughput)
  - Is consumed by the Helix xunit.console runner via _XunitOptions
  - Composes cleanly with existing per-project overrides:
      * Client.ChannelLayer: '-maxthreads 4 -maxthreads 16' (project wins, last value)
      * Client.ClientBase / Security.TransportSecurity: '-maxthreads 4 -parallel none'
        (parallel none disables threading regardless of maxthreads)
  - Can be overridden per-project by setting WcfHelixMaxThreads before
    the global default applies.

Verified on WSL Ubuntu-24.04 with the SelfHostedCoreWCFService running
and dotnet test pinned to 2 CPUs via 'taskset -c 0,1'. All 63 PR-affected
WebSocket test cases (WebSocket_Http_Duplex_Buffered, WebSocket_Http/Https_
RequestReply_*) pass in 23 s with the cap applied. The pre-existing
WebSocket_Http_Duplex_Streamed failures reproduce identically on main
(both with and without the cap), confirming they are unrelated to PR dotnet#5940.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
afifi-ins and others added 2 commits May 20, 2026 03:18
The integration test suite calls Close() unconditionally after PR dotnet#5940
(revert of WebSocket close workaround). On resource-constrained Helix
Linux Open queues (2-4 vCPU), running tests at default parallelism can
starve the SelfHosted(Core)WCF service and cause WebSocket close
handshakes to time out, matching the failure pattern in issue dotnet#5819.

Add a global default to Directory.Build.props that caps -maxthreads at
min(ProcessorCount, 4) for any project with IsTestProject=true. This:
  - Resolves to '-maxthreads 2' on 2-vCPU Helix VMs (Linux Open queues)
  - Resolves to '-maxthreads 4' on 16-core dev boxes (preserves throughput)
  - Is consumed by the Helix xunit.console runner via _XunitOptions
  - Composes cleanly with existing per-project overrides:
      * Client.ChannelLayer: '-maxthreads 4 -maxthreads 16' (project wins, last value)
      * Client.ClientBase / Security.TransportSecurity: '-maxthreads 4 -parallel none'
        (parallel none disables threading regardless of maxthreads)
  - Can be overridden per-project by setting WcfHelixMaxThreads before
    the global default applies.

Verified on WSL Ubuntu-24.04 with the SelfHostedCoreWCFService running
and dotnet test pinned to 2 CPUs via 'taskset -c 0,1'. All 63 PR-affected
WebSocket test cases (WebSocket_Http_Duplex_Buffered, WebSocket_Http/Https_
RequestReply_*) pass in 23 s with the cap applied. The pre-existing
WebSocket_Http_Duplex_Streamed failures reproduce identically on main
(both with and without the cap), confirming they are unrelated to PR dotnet#5940.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@afifi-ins afifi-ins force-pushed the revert-websocket-issue-5818 branch from b76d916 to d29320c Compare May 20, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant