-
Notifications
You must be signed in to change notification settings - Fork 538
Closed
Description
Sometimes pgbouncer close transaction because of idle_transaction_timeout when it shouldn't. i.e. application run some slow queries (duration of query could be larger than timeout) one after another without significant delay between them (confirmed by logs).
steps to reproduce:
- set idle_transaction_timeout = 1 in config, reload.
- create file with simple transaction:
cat ~/test-idle.sql
begin;
select pg_sleep(1);
select pg_sleep(2);
rollback; - make sure you are able to connect to some db via pgbouncer without password (add password to ~/.pgpass for example) and run
for i in {1..1000}; do psql -p 6432 -h 127.0.0.1 -U postgres -f ~/test-idle.sql || break; done 1>/dev/null
- wait until you see error messages like this:
psql:/var/lib/pgsql/test-idle.sql:2: ERROR: idle transaction timeout
psql:/var/lib/pgsql/test-idle.sql:3: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
psql:/var/lib/pgsql/test-idle.sql:3: connection to server was lost
it could take several minutes. script will stop after error.
reproduced with pgbouncer 1.7.2 at centos 7.2.1511. I guess problem is somewhere in these lines:
Line 470 in 28adb8d
| age = now - server->link->request_time; |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels