<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Hello everyone! It is my first time posting to this list.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">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 "<span style="font-family:Arial,Helvetica,sans-serif">terminating connection due to idle-se</span><span style="font-family:Arial,Helvetica,sans-serif">ssion timeout</span><span class="gmail_default">" fatal errors.</span></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><span class="gmail_default"><br></span></div><div class="gmail_default" style="font-size:small"><span class="gmail_default"><font face="arial, helvetica, sans-serif">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 `</font><font face="monospace">idle_in_transaction_session_timeout</font><font face="arial, helvetica, sans-serif">` parametre set to 300 seconds.</font></span></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><span class="gmail_default"><br></span></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><span class="gmail_default">```</span></div><div class="gmail_default" style="font-size:small"><font face="monospace">Mar 22 13:14:18 pdns1 pdns_server[5414]: Backend reported permanent error which prevented lookup (GSQLBackend unable to lookup '<a href="http://host.domain.com" target="_blank">host.domain.com</a>|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<br>ssion timeout</font><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">```</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-family:arial,helvetica,sans-serif">This means that, when a client has finished sending commands as part of a transaction, but has not closed the transaction (via `</span><font face="monospace">END TRANSACTION</font><font face="arial, helvetica, sans-serif">`), then PostgreSQL terminates that connection, as we can clearly see in the log (expected behaviour) [3].</font><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">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.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">So I would like to know, in regards to PowerDNS, about these two things:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">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)?</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">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?</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Thanks.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">[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.</div><div class="gmail_default" style="font-size:small"><span style="font-family:arial,helvetica,sans-serif">[2] Configured at `</span><font face="monospace">/etc/powerdns/pdns.d/gpgsql.conf`</font><font face="arial, helvetica, sans-serif">.</font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">[3] </font><a href="https://www.postgresql.org/docs/13/runtime-config-client.html" target="_blank">https://www.postgresql.org/docs/13/runtime-config-client.html</a> and <a href="https://pgpedia.info/i/idle_in_transaction_session_timeout.html" target="_blank">https://pgpedia.info/i/idle_in_transaction_session_timeout.html</a></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Jaume Sabater<br>"Ubi sapientas ibi libertas"</div></div></div></div>