[Pdns-users] Fatal errors due to idle session timeout

Jaume Sabater jsabater at gmail.com
Fri Mar 22 13:35:30 UTC 2024


Hello everyone! It is my first time posting to this list.

So I have a PowerDNS 4.4.1 installation on Debian 11 Bullseye (default
packages) [1] and in the /var/log/syslog file I fairly often find
these "terminating
connection due to idle-session timeout" fatal errors.

The thing is that my PowerDNS uses PostgreSQL 13 as backend [2], and the
PostgreSQL server, which resides in a separate container, indeed has the `
idle_in_transaction_session_timeout` parametre set to 300 seconds.

```
Mar 22 13:14:18 pdns1 pdns_server[5414]: Backend reported permanent error
which prevented lookup (GSQLBackend unable to lookup
'host.domain.com|SOA':Fatal
error during query: SELECT
content,ttl,prio,type,domain_id,disabled::int,na me,auth::int FROM records
WHERE disabled=false and type=$1 and name=$2: FATAL:  terminating
connection due to idle-se
ssion timeout
```

This means that, when a client has finished sending commands as part of a
transaction, but has not closed the transaction (via `END TRANSACTION`),
then PostgreSQL terminates that connection, as we can clearly see in the
log (expected behaviour) [3].

Generally speaking, the way that applications *should* behave is, in short,
making sure they execute transactions (implicit or explicit) as quickly as
possible and that those transactions begin and end.

So I would like to know, in regards to PowerDNS, about these two things:

1. Is it correct to say that PowerDNS does not close the transaction when
querying the database for records, maybe not directly but through the way
the PostgreSQL driver is used (maybe implicit transactions, maybe
connection pooling)?

2. Does PowerDNS retry such a query after opening a new connection, or does
it return an error to the client performing the DNS query?

Thanks.

[1] Pending upgrade to PowerDNS 4.7.3 when upgrading to Debian 12 Bookworm,
as PowerDNS 4.4 already reached its end of life date.
[2] Configured at `/etc/powerdns/pdns.d/gpgsql.conf`.
[3] https://www.postgresql.org/docs/13/runtime-config-client.html and
https://pgpedia.info/i/idle_in_transaction_session_timeout.html

-- 
Jaume Sabater
"Ubi sapientas ibi libertas"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20240322/af81cfdf/attachment.htm>


More information about the Pdns-users mailing list