sql: fix data race in MemberOfWithAdminOption#98376
sql: fix data race in MemberOfWithAdminOption#98376andyyang890 wants to merge 1 commit intocockroachdb:masterfrom
Conversation
Previously, there was a data race in the `MemberOfWithAdminOption` function where a context cancellation would cause a transaction to attempt to clean itself up before a singleflight query using that transaction had completed. Release note: None
|
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
rafiss
left a comment
There was a problem hiding this comment.
nice find! i wonder if the same issue could be affecting all the other usages of singleflight. (and if so, if the fix should be done in that package)
|
This will affect all the singleflights where an outer transaction is used. |
ajwerner
left a comment
There was a problem hiding this comment.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @andyyang890)
@rafiss I created another PR with an alternative fix that involves mitigating the data race within the |
|
if possible, could we add a more targeted test that catches this bug? it feels kind of lucky to me that |
|
Closed in favor of #98617 |
Previously, there was a data race in the
MemberOfWithAdminOptionfunction where a context cancellation would cause a transaction
to attempt to clean itself up before a singleflight query using
that transaction had completed.
Fixes #95642
Fixes #96539
Release note: None