Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBD rhobustness #1

Open
jnorell opened this issue Apr 25, 2011 · 4 comments
Open

DBD rhobustness #1

jnorell opened this issue Apr 25, 2011 · 4 comments

Comments

@jnorell
Copy link
Owner

jnorell commented Apr 25, 2011

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:

DBD::Pg::st execute failed: server closed the connection unexpectedly
 This probably means the server terminated abnormally
 before or while processing the request. at ./dbmail-postfix-policyd line 153.

Need to make the dbi pieces more rhobust: attempt reconnect to server, check for errors on function calls, etc.

@jnorell
Copy link
Owner Author

jnorell commented Apr 27, 2011

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.

@jnorell
Copy link
Owner Author

jnorell commented May 3, 2011

Still happening even after yesterday's commit which intended to fix this. (error on line 225 now)

@jnorell
Copy link
Owner Author

jnorell commented May 5, 2011

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.

@jnorell
Copy link
Owner Author

jnorell commented May 5, 2011

In more digging, this is probably an tcp keepalive issue - I'll see about setting SO_KEEPALIVE on the database socket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant