-
Notifications
You must be signed in to change notification settings - Fork 2
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 locks to Read and Write #64
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Ryan! Approved with 1 nit.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @matthewstevenson88 and @Ryanfsdf)
security/s2a/internal/record/record.go, line 162 at r1 (raw file):
// hsAddr stores the address of the S2A handshaker service. hsAddr string // readMutex guards the Read implementation.
nit: s/the Read implementation/against concurrent calls to Read.
Similarly for the write mutex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Ryanfsdf)
security/s2a/internal/record/record.go, line 165 at r2 (raw file):
// hsAddr stores the address of the S2A handshaker service. hsAddr string // readMutex guards against concurrent calls to Read.
Can you please add more info in the comment about why we need this mutex? Same for write. This way we can remember why we added them in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @cesarghali)
security/s2a/internal/record/record.go, line 165 at r2 (raw file):
Previously, cesarghali (Cesar Ghali) wrote…
Can you please add more info in the comment about why we need this mutex? Same for write. This way we can remember why we added them in the future.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @cesarghali)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved
Added locks to Read, Write, and Close.
These locks are needed to safely read, write, and close concurrently.
This change is