You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Live VCS status/diff test on Windows: 'connection forcibly closed by the remote host' #472
VcsClientLiveTests.GetStatusAsync_And_GetDiffAsync_Should_Report_A_Modified_Tracked_File failed once on the Windows CI leg (net10.0). Its pinned live server dropped the connection mid-request.
Test:tests/OpenCode.Sdk.Tests/Vcs/VcsClientLiveTests.cs:73, on OpenCode.Sdk.Tests.dll (net10.0|x64); 10.5 s to failure.
Error:
[Test Failure] OpenCodeTransportException: The opencode server could not be reached.
---> System.Net.Http.HttpRequestException: An error occurred while sending the request.
---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
What would settle it: the retained server log for this test from the run's artifacts, which would show whether the server exited, restarted or reset the socket at that moment.
Rerun result: the rerun of the failed Windows job in run 39077427835 (same head 80ddef3e, no code change) passed, VcsClientLiveTests included. So this is an intermittent failure, not a deterministic one on that head.
Setup: a client against the pinned server (2.0.32) on Windows. Each attempt makes one request, waits a delay d around the server's idle close, and then reuses the connection. There were six delays from T−200 ms to T+50 ms, 10 attempts each, on net10.0 and on net472. A second client with a shorter idle timeout served as the control.
The server's idle close: T ≈ 6.0 s (median 6017 ms over 3 samples). The server advertises Connection: keep-alive and Keep-Alive: timeout=5.
Result: 240 of 240 attempts succeeded, controls included, with 0 resets. The offsets are 10 ms apart and the close was measured with 25 ms polling, so a narrower close-while-sending race is not ruled out.
Gap found. The SDK sets no idle timeout. The modern transport sets only PooledConnectionLifetime (120 s), so the default 60 s idle applies; net472 sets no ServicePoint.MaxIdleTime. A pooled connection can therefore outlive the server's 5–6 s idle close.
A clean close is caught by the handler's reuse check, which is why the probe stays green.
A reset that lands while a request is being sent surfaces as a non-retryable HttpRequestException, which matches this failure.
Upstream's first-party client (undici under Node) honours the Keep-Alive hint minus 2 s, so it does not reuse a connection idle for more than about 3 s.
Next: an idle timeout below the server's hint, as parity hardening, is with the maintainer. It is not claimed as a proven fix for this failure. This issue stays open under #506 until that decision.
Activity
Blind-Striker commentedon Oct 17, 2026
Rerun result: the rerun of the failed Windows job in run 39077427835 (same head
80ddef3e, no code change) passed,VcsClientLiveTestsincluded. So this is an intermittent failure, not a deterministic one on that head.Blind-Striker commentedon Oct 18, 2026
Targeted probe: not reproduced.
Setup: a client against the pinned server (2.0.32) on Windows. Each attempt makes one request, waits a delay
daround the server's idle close, and then reuses the connection. There were six delays from T−200 ms to T+50 ms, 10 attempts each, on net10.0 and on net472. A second client with a shorter idle timeout served as the control.Connection: keep-aliveandKeep-Alive: timeout=5.Gap found. The SDK sets no idle timeout. The modern transport sets only
PooledConnectionLifetime(120 s), so the default 60 s idle applies; net472 sets noServicePoint.MaxIdleTime. A pooled connection can therefore outlive the server's 5–6 s idle close.HttpRequestException, which matches this failure.Upstream's first-party client (undici under Node) honours the
Keep-Alivehint minus 2 s, so it does not reuse a connection idle for more than about 3 s.Next: an idle timeout below the server's hint, as parity hardening, is with the maintainer. It is not claimed as a proven fix for this failure. This issue stays open under #506 until that decision.