-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 6.3.0
-
Component/s: Transactions
Use Case
As a developer utilizing the MongoDB Node.js driver for transactional operations,
I want to be able to catch MongoRuntimeErrors, caused by invalid state transitions.
So that my application can manage transactional flows more predictably and recover from errors gracefully.
The error thrown here: https://github.com/mongodb/node-mongodb-native/blob/main/src/transactions.ts#L168 is not handled via the callback in the following lines:
https://github.com/mongodb/node-mongodb-native/blob/main/src/sessions.ts#L663
https://github.com/mongodb/node-mongodb-native/blob/main/src/sessions.ts#L677
https://github.com/mongodb/node-mongodb-native/blob/main/src/sessions.ts#L723
https://github.com/mongodb/node-mongodb-native/blob/main/src/sessions.ts#L732
https://github.com/mongodb/node-mongodb-native/blob/main/src/sessions.ts#L990
https://github.com/mongodb/node-mongodb-native/blob/main/src/sessions.ts#L1016
User Impact
This issue potentially impacts all users of the driver who rely on transactions, especially in production environments where unhandled exceptions can lead to application instability or downtime.
The severity of the impact is high, as unhandled exceptions can crash the application or lead to inconsistent transaction states.
Dependencies
Unknowns
The exact conditions under which the MongoRuntimeError is thrown within the transaction state machine are unclear and need to be investigated.
Whether there are other unhandled exceptions in the transaction handler or other parts of the driver that could cause similar issues.
Acceptance Criteria
All errors during a transactions should bubble up to the caller so the application can handle them accordingly.