-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
In the WithTransaction code, we use the context passed to WithTransaction to call AbortTransaction. This means that AbortTransaction would fail if the context timed out or was cancelled during the execution of the user-supplied callback and we'd leave an in-progress transaction running after returning.
I'm not sure how to best mitigate this. We could run AbortTransaction with context.Background() to ensure it can execute, but this is a deviation from the behavior of contexts because we shouldn't be doing blocking work once the context has expired.