[GODRIVER-2565] Context cancelation before transaction commit does not abort Created: 30/Sep/22 Updated: 28/Oct/23 Resolved: 31/Oct/22 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | 1.10.2 |
| Fix Version/s: | 1.11.0, 1.10.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Benji Rewis (Inactive) | Assignee: | Benji Rewis (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Documentation Changes: | Not Needed | ||||||||||||||||
| Description |
|
The title of this ticket is my best guess at what's happening in the following situation |
| Comments |
| Comment by Benji Rewis (Inactive) [ 31/Oct/22 ] |
|
We now call AbortTranasction if the context has errored right before the CommitLoop in WithTransaction. This should help reduce the possibility that transactions are left open server-side when the context errors in WithtTransaction. Note that if the context errors after the new check and before commitTransaction is actually sent to the server, the transaction will still be left open server-side. |
| Comment by Githook User [ 31/Oct/22 ] |
|
Author: {'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}Message: |
| Comment by Githook User [ 31/Oct/22 ] |
|
Author: {'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}Message: |
| Comment by Benji Rewis (Inactive) [ 26/Oct/22 ] |
| Comment by Benji Rewis (Inactive) [ 13/Oct/22 ] |
|
Apologies for the delay in response. I can repro the issue and I believe it’s happening because we never run AbortTransaction when CommitTransaction fails in WithTransaction (whether due to timeout or anything else). This is the specified behavior for all drivers, but is a little strange when we know the CommitTransaction call will fail due to something like a canceled context. Opened DRIVERS-2471 to consider a cross-drivers change. In the meantime, I may add a context error check right before CommitTransaction in WithTransaction here, but I think there could still be a context error during CommitTransaction that would cause the transaction to remain open on the server... |