Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

m_sentPackets sequence fix & some other minor changes #171

Closed

Conversation

jorgenpt
Copy link
Contributor

@jorgenpt jorgenpt commented Jan 14, 2022

  • Fix the assert that triggers if you only intermittently send reliable messages
  • Clean up the acked field which isn't being used

When a reliable channel is dormant (no messages sent) for an extended
period of time, it will trigger an assert when it reactivates (the next
time you send a message). This occurs because reliable's sequence number
will continue to increment, and the SequenceBuffer will assume the
packet is too old when we try to insert it. Since we're sending, we know
that's not true, so this adds a new `InsertAndIgnoreAge` method to
`SequenceBuffer` and converts the reliable channel sending to use that
instead.

Fixes mas-bandwidth#138 and mas-bandwidth#146.
`SentPacketEntry::acked` never had a `1` written to it, so the code that
checked for it was no-op. This removes the field and instead removes the
acked packet from the `m_sentPackets`, so that we do not double-process
a packet (which we would do previously, but it would just be a no-op
since the packets were already removed from the `m_messageSendQueue`.
@jorgenpt jorgenpt force-pushed the sentpackets-sequence-fix branch from e384bc7 to a0204b8 Compare January 14, 2022 23:48
@jorgenpt
Copy link
Contributor Author

Not sure why this is failing on macOS, I'll investigate.

@jorgenpt
Copy link
Contributor Author

Huh. It ran fine when it was re-run, and I wasn't able to reproduce.

@JoeShiverblade
Copy link

@gafferongames whenever you have time I'd love to hear your thoughts on this PR. It looks like a great fix to get rid of having to send dummy reliable packets to avoid the issue, but was curious as to what you think.

@gafferongames
Copy link
Contributor

I'm concerned around the heisenbug on tests. Please run locally on MacOS and loop the tests (while true). If it's an intermittent timing related test failure, then this approach usually catches it.

@gafferongames
Copy link
Contributor

I believe this has been fixed in another PR. If I'm wrong, please let me know.

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.

3 participants