[GODRIVER-1852] Failure during CommitTransaction still moves state to Committed Created: 28/Jan/21  Updated: 28/Oct/23  Resolved: 26/Feb/21

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.0

Type: Bug Priority: Minor - P4
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

Documentation Changes: Not Needed

 Description   

During a transaction, if a CommitTransaction times out, the client session state is still moved to "Committed".

This is inaccurate, as the operations within the commit will not have actually reached the server, so the transaction is not "Committed". Furthermore, if users attempt to abort the transaction when the CommitTransaction fails, they will encounter a "cannot call abortTransaction after calling commitTransaction" error, which is likely an unexpected error.

The issue is likely here, where we set session state to "Committed" without checking for potential errors from operation execution.



 Comments   
Comment by Githook User [ 26/Feb/21 ]

Author:

{'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}

Message: GODRIVER-1852 Add commitTransaction error check for timeout (#569)
Branch: release/1.5
https://github.com/mongodb/mongo-go-driver/commit/b03a7e4ce2c051ec212bc90150a7e6f830e7b3dc

Comment by Githook User [ 26/Feb/21 ]

Author:

{'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}

Message: GODRIVER-1852 Add commitTransaction error check for timeout (#569)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/1c2620e3a8f77b00a25cfe95032e2783606d003c

Comment by Benji Rewis (Inactive) [ 29/Jan/21 ]

https://github.com/mongodb/mongo-go-driver/pull/569

Generated at Thu Feb 08 08:37:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.