Skip to content

Conversation

@ljwoods2
Copy link
Collaborator

@ljwoods2 ljwoods2 commented Nov 9, 2025

Fixes #96

Changes made in this Pull Request:

  • Don't change timeout when pausing/unpausing

Bug was occurring because of the following rare event:

  • Client pauses simulation, sets timeout to 0 to make socket reads blocking
  • Simulation writes an IMDFrame to its socket write buffer, and only i.e. the time packet is delivered "immediately"
  • Simulation (correctly) stops sending new frames, but current frame is still in transit
  • Client attempts to read an entire frame from the socket, finding only a time packet instead (since the rest is still in-transit)
  • Since socket read is currently blocking, client fails out erroneously

This was based on the erroneous assumption that only full frames would be in memory when the simulation was paused, however, this is not true; packets could still be in transit which the simulation engine called write() on before the pause was acknowledged.

Thanks to @amruthesht for figuring this out

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

@codecov
Copy link

codecov bot commented Nov 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.29%. Comparing base (07069e1) to head (5d7c1e1).
⚠️ Report is 3 commits behind head on main.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@ljwoods2 ljwoods2 merged commit d68ed9a into main Nov 9, 2025
21 checks passed
@ljwoods2 ljwoods2 deleted the race-condition branch November 9, 2025 01:12
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.

TCP connection drops with high throughput

3 participants