Closed sykesm closed 5 years ago
I can confirm that this patch fixes the race.
Ping. Can we get this merged please?
Sorry about the delay, taking a look. Going to ping @deckarep since this looks related to the work from #232. @sykesm @tsuna @deckarep is this a missed spot from that PR? If so, I'll merge right away, but want to make sure I'm not missing something first. Thanks all!
Not sure what you meant by "is this a missed spot from that PR?". If you're asking whether this fixes the race, then yes it does, I can confirm from my review of the code and my CI builds with -race
passing with it.
@tsuna the linked PR switched from using mutexes to using CAS. It is my understanding that this race was likely introduced at that point because one instance of mutex was not updated. I want to confirm that my understanding is correct. I don't look at this code very frequently any more, so I want to make sure I understand where the bug comes from, lest we introduce yet another one somewhere else.
One code path was using a CAS, the other a mutex, that's no bueno. Either both should use a mutex or both should use a CAS. This fix removes the mutex altogether so that only CAS is used.
Let me look stand by
Going off my memory, yes this is related and the change makes sense...I probably did not catch this race...I also remember attempting to leave the stop logic as is.
This fix LGTM.
👏 seems like we're all on the same page.
Fixes #245