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

Return a copy from the memstore to avoid data races #708

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Nocccer
Copy link

@Nocccer Nocccer commented Mar 15, 2025

Description

To avoid data races that occured in #703, a copy is now returned by the memstore instead a pointer to the packet.

  • Extend the ControlPacket interface with Copy() ControlPacket function.
  • Add tests to check if the copy does not share any pointer with the original packet.
  • Use the Copy() function in the memstore to return a copy.
  • Test changes against the test from Data race while reconnecting #703 that triggered the race condition.

Note: This is my private github account, so don't get confused.

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.

1 participant