loopbackio / loopbackio/loopback-connector-postgresql

Release called on client which has already been released to the pool

Open
#493 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
118
Forks
184
Avg merge
1d 22h
Merged PRs (30d)
5

Description

Steps to reproduce

  1. Use loopback-connector-postgresql 5.5.0 (5.4.0 does not exhibit this issue)
  2. Commit a transaction with an error (ex: unique key violation)
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.