Closed sparrc closed 7 years ago
I don't have a very concise example I can show to reproduce this, but you can see from the output that Goroutine 36 is being spun up within the consumergroup and is not something I have control over. My code spins up Goroutine 41 and calls CommitUpTo which eventually calls pOT.markAsProcessed().
The markAsProcessed call has a conflict with a read that is performed by the FinalizePartition() call. Adding a heavier lock to this function really shouldn't have an impact on performance because this function only gets called once per partition.
:+1: on this, I'm reproducing the same issue
@wvanbergen What do you think of this PR? Any thoughts?
I have to spend some time on a good review. I remember making the locking more granular like this, to prevent potential deadlocks. This is a while ago though, so that may no longer be true or relevant.
closing this because it doesn't appear to be getting merged
When running
ConsumerGroup.CommitUpTo(msg)
in a goroutine, I get a race condition betweenFinalizePartition
andCommitUpTo
Below is the race condition that I get when running with the race detector: