loopbackio / loopbackio/loopback-connector-postgresql
Release called on client which has already been released to the pool
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 118
- Forks
- 184
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 5
Description
Steps to reproduce
- Use loopback-connector-postgresql 5.5.0 (5.4.0 does not exhibit this issue)
- Commit a transaction with an error (ex: unique key violation)
- Rollback the transaction
Current Behavior
Calling transaction.commit and subsequently transaction.rollback if there is a commit error results in:
The following error from pg-pool in the rollback is uncaught and crashes the server: Release called on client which has already been released to the pool
I would expect the error to be caught (perhaps in PostgreSQL.prototype.releaseConnection?) and passed along without crashing the server
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at PostgreSQL.prototype.releaseConnection and reproduce the transaction commit-error followed by rollback using loopback-connector-postgresql 5.5.0. Compare the rollback path with the pg-pool release behavior; done means the release error is caught and passed along without crashing the server.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs, postgresql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100