jackc / jackc/booklog

pgxpool hangs after number of queries on the order of max connections

Open
#15 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
10
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Hi,

Thanks so much for putting up this example. I've been trying to learning golang web services and was using your booklog as one of the core examples.

Currently, I'm using pgx v4 + gochi v5, I'm using code similar to your DbConn interface to hide the Pool pointer, but after handling a number of db-heavy (calling stored procs, etc, but never batched, always single statement) web requests, the pool just hangs (presumably getting a new connection) afterwards.

I feel like I must be doing something wrong. However, your booklog example doesn't do anything to close connections explicitly. If you have any pointers as to why Pool is hanging after some number of query executions, I would really appreciate it!

Best,

Tom

Contributor guide

No contributing guide indexed for this repository

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 by reviewing the booklog example and its DbConn interface, then reproduce the reported hang with pgx v4 and go-chi v5 after repeated database-heavy requests. Trace pool usage and connection handling; done means identifying the cause of the pool waiting and documenting or correcting the example accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.