Open jnorell opened 13 years ago
Reproduced that error again (now on line 183) by leaving dbmail-postfix-policyd running overnight without postfix forwarding mail to it. No errors in postgresql main.log. Another active dbmail-postfix-policyd ran overnight connected to the same database backend, without problem. Definitely something related to idle connections here.
Still happening even after yesterday's commit which intended to fix this. (error on line 225 now)
Still not fixed on the idle postgres connection, though it's improved. It no longer dies, but it does stop checking, with messages like:
dbmail_v1_quota_check: checking addr@domain (recurse_depth 0) DBD::Pg::st execute failed: no connection to the server at ./dbmail-postfix-policyd line 262. dbmail_v1_quota_check: alias_sth: DBI::st=HASH(0x86c1dd8)->errstr
A HUP will reconnect to the database and all starts working again.
In more digging, this is probably an tcp keepalive issue - I'll see about setting SO_KEEPALIVE on the database socket.
I left dbmail-postfix-policyd running idle over the weekend, connected to a postfix back end. When I set pointed postfix to it this morning, it immediately died with:
Need to make the dbi pieces more rhobust: attempt reconnect to server, check for errors on function calls, etc.