Extremely unlikely race conditions in internal::AsyncRetryLoop()
#7788
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Consider the current implementation of the asynchronous retry loop, in particular how the
pending_operation_
is set after the callback may have been invoked:google-cloud-cpp/google/cloud/internal/async_retry_loop.h
Lines 111 to 115 in 0c09efc
If the callback is immediately completed (or the scheduler puts a long sleep before line 115) the
pending_operation_
may be set to a future that is no longer active, which means the cancel request has no effect:google-cloud-cpp/google/cloud/internal/async_retry_loop.h
Lines 192 to 200 in 0c09efc
This is extremely rare, it would require multiple operations completing very fast, and separate threads going to sleep. Nevertheless, we should fix this.
The text was updated successfully, but these errors were encountered: