Fix CPU spin in recv4/recv6 when ReadFrom returns errors#2
Closed
DerAndereAndi wants to merge 3 commits intodevfrom
Closed
Fix CPU spin in recv4/recv6 when ReadFrom returns errors#2DerAndereAndi wants to merge 3 commits intodevfrom
DerAndereAndi wants to merge 3 commits intodevfrom
Conversation
When connections are closed externally (e.g., network interface changes on Windows), the recv4/recv6 loops spin at 100% CPU because ReadFrom returns errors immediately and the code continues without backoff. This test simulates the condition by closing connections without going through the normal Shutdown path, then measures allocation rate to detect the spin (31M+ allocations in 500ms confirms the bug).
When connections are closed externally (e.g., network interface changes on Windows), ReadFrom returns errors immediately. The previous code used a bare 'continue' which caused a tight loop spinning at 100% CPU. Add 50ms backoff on errors with shutdown check to prevent CPU exhaustion while still allowing clean shutdown during the backoff. Fixes issue where Windows systems would consume all CPU after hours of running when network conditions change.
The pl-strflt/uci reusable workflows are no longer accessible. Replace with self-contained workflow definitions: - go-test.yml: Full test suite on Ubuntu (mDNS multicast works), build + unit tests only on macOS/Windows (multicast blocked in CI) - go-check.yml: Run gofmt, go vet, staticcheck, and go mod tidy checks Also: - Add dev branch to push triggers - Increase TTL test timeout from 5s to 10s for CI timing tolerance
cd95bae to
9297361
Compare
Contributor
|
close in favor of #3 |
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.
When connections are closed externally (e.g., network interface changes on Windows), ReadFrom returns errors immediately. The previous code used a bare 'continue' which caused a tight loop spinning at 100% CPU.
Add 50ms backoff on errors with shutdown check to prevent CPU exhaustion while still allowing clean shutdown during the backoff.
Fixes issue where Windows systems would consume all CPU after hours of running when network conditions change.