Repository navigation
fix(transaction): Only rollback if connection was acquired - #9051
Conversation
|
I guess we can try to make a testcase, but it will be very messy. We have to stub a failure in acquiring a connection and then check for unhandled rejections. I am not sure such a testcase will do much good, but happy to take suggestions on how to build a proper testcase. |
|
Have same issue. This PR fixes it. |
|
We get this error from time to time, and it would be really helpful to have this merged. |
|
It is getting a bit frustrating to have submitted PR's to fix issues, and they are just left to rot. Can we get this properly reviewed please` |
|
@holm Have some patience please. Its a large project, I have a job, I am working on v5, still reviewing and merging stuff almost on daily basis. Thanks for debugging and fixing this. As I said before this PR is missing a test case, which I think is important and I am trying to eventually get back to this, but that will take some time. |
|
I also think this is a rather critical issue since it results in unhandled promise rejections at least under load. I have created a test case for this one that should clearly show the impact. |
test: add pool rejection test
|
Thanks, I merged your testcase into this PR |
|
@sushantdhiman as I can see, @holm has already added testcase for that PR, do you have any plans to merge it? |
|
@itsmepetrov Yes, I'll verify and merge this fix tomorrow morning |
sushantdhiman
left a comment
There was a problem hiding this comment.
Fix Verified!! LGTM
|
🎉 This PR is included in version 4.37.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Pull Request check-list
Please make sure to review and check all of these items:
npm run testornpm run test-DIALECTpass with this change (including linting)?Description of change
This fixes #8087. Before a transaction was always attempted to be rolled back, even if the transaction had not started yet. This could happen when a connection could not be acquired, for whatever reason.
I don't think writing a test for this is worth the effort.