-
Type:
Task
-
Resolution: Works as Designed
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Concurrency
-
None
-
Replication
-
None
-
3
-
TBD
-
None
-
None
-
None
-
None
-
None
-
None
Currently in the TransactionCoordinator instances, it appears that the _done member function is only invoked when the deadline expires. It seems like the correct behavior should be to invoke _done when the TransactionCoordinator finishes its work before the deadline, and not make waiting threads block until the deadline has passed.
The _done callback is currently scheduled at the end of deadlineFuture once the continuation chain has reached its final continuation in getAsync here..]
I believe when the deadline is reached before success, cancelling the scheduler is supposed to cause the tasks in the continuation chain started here to fail with cancellation errors, and then the final getAsync runs which schedules getAsync on the already expired deadlineFuture which should be "immediately" invoked.
When success happens before the deadline is reached, the opposite happens and the final getAsync mentioned above is scheduled on the deadlineFuture but crucially, it is never executed until the deadline passes. That _done callback is the only place that _completionPromise is set, which is what unblocks waiting threads in the catalog components or the transaction coordinator service during createCoordinator.