Repository navigation
ngprism: don't exit on a failed heartbeat under Windows - #315
Merged
davexparker merged 1 commit intoNov 6, 2026
Merged
Conversation
Heartbeats are sent from a separate thread on Windows, so one can fail just as the server finishes a run. This made the client exit with an error, despite the run having succeeded, which aborts prism-auto. A check to ignore such failures was already present, but it relied on errno being EPIPE, and Winsock does not set errno.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes an intermittent failure of the Windows CI jobs, where
make testsaborts withFailure: 0and asend: No errorline in the log, e.g. this run (ctmc-until.sm) and this one (brp_int.prism).Cause: on Windows,
ngprismsends heartbeats from a separate thread, every 500ms. One can fail just as a run ends, and the client then exits with an error even though the run succeeded.prism-autostops at any non-zero exit code, so the whole test run is abandoned.sendChunkalready tries to ignore such failures, but it checks forerrno == EPIPE. Winsock doesn't seterrno(which is also why the message is "No error"), so the check never applies on Windows.Fix: on Windows, ignore any failed heartbeat. The main thread still gets the real exit code from the server, or sees a failed
recv()if the server has really gone. Other platforms send heartbeats from the main loop and are unchanged: the preprocessed source is identical on macOS.Testing: the Windows code has not been compiled locally, so this PR's CI is its first build. The failure is rare (2 of the last 12 failed runs), so one green run shows that it builds and passes but doesn't prove the race has gone. The diagnosis comes from the code and logs: the failure hasn't been reproduced, and the actual Winsock error wasn't recorded.