Skip to content

Conversation

@DerAndereAndi
Copy link
Member

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.

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.
@DerAndereAndi DerAndereAndi added the bug Something isn't working label Dec 28, 2025
@DerAndereAndi DerAndereAndi changed the base branch from master to dev December 28, 2025 13:53
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
@DerAndereAndi DerAndereAndi force-pushed the bugfix/cpu-spin-on-connection-error branch from cd95bae to 9297361 Compare December 28, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants