Performance Issue with withTransaction API Causing Prolonged Execution and 502 Errors #14939
Open
2 tasks done
Labels
needs clarification
This issue doesn't have enough information to be actionable. Close after 14 days of inactivity
Prerequisites
Mongoose version
8.7.0
Node.js version
20.11.1
MongoDB server version
8.0.0
Typescript version (if applicable)
5.5.3
Description
When using the withTransaction API with Mongoose to handle transactions, I’m encountering significant delays that ultimately result in 502 errors. However, when I handle transactions manually (starting, committing, and aborting), the same operations complete successfully and within expected timeframes. This suggests an inefficiency or potential bug within withTransaction.
Steps to Reproduce
Expected Behavior
The withTransaction API should handle transactions efficiently, ensuring all operations are either committed or rolled back in a timely manner without introducing unexpected delays.
Observed Behavior
Prolonged transaction times, resulting in 502 errors.
The issue does not occur with manual transaction handling (startTransaction, commitTransaction, and abortTransaction).
Delays are more noticeable under higher loads or with concurrent transactions.
The text was updated successfully, but these errors were encountered: