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

Add synchronization to payloadQueue map access #115

Closed
wants to merge 1 commit into from

Conversation

cohosh
Copy link
Contributor

@cohosh cohosh commented Feb 25, 2020

Map access are not concurrency safe, and the chunkmap of a payloadQueue
is accessed by multiple goroutines. This commit adds a RWMutex to
chunkmap accesses.

Description

This PR is a possible solution to Issue #114. In any case, it fixes a race condition for maps that are accessed by multiple goroutines.

Reference issue

Fixes #114

Map access are not concurrency safe, and the chunkmap of a payloadQueue
is accessed by multiple goroutines. This commit adds a RWMutex to
chunkmap accesses.
@cohosh
Copy link
Contributor Author

cohosh commented Feb 26, 2020

Alright, I'm not sure if you still want to add this considering #110 actually fixed the issue I was having. Sounds like we weren't triggering race conditions afterall.

@enobufs
Copy link
Member

enobufs commented Feb 27, 2020

@cohosh The inflightQueue (which is a payloadQueue) is solely owned and accessed by Association, and it is protected by Association.lock. I have just gone over the code to double-check that and verified that's the case. Let me close this PR.

@enobufs enobufs closed this Feb 27, 2020
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.

Race condition for chunkmap access in payloadQueue
2 participants