Forum OpenACS Q&A: Better handling of PostgreSQL shutdown/startup
Every so often, for reasons that I don't understand, they seem to restart their PostgreSQL server. Why and when is an issue that I'll take up with them separately. What I'm curious about is the fact that the PostgreSQL driver doesn't seem to be smart enough to reconnect as necessary if the database server dies and restarts.
If the driver *is* smart enough to reconnect, then perhaps it's just a startup issue on my machine. But if it isn't this smart, then I wonder how hard it would be to to get AOLServer to reconnect.
One is where an individual backend dies -- this is properly reconnected.
Two is when the postmaster dies -- this is not currently reconnected. I am looking at ways of doing this, but it is going to take some time to properly troubleshoot.
In the interim, ask Marc (or whoever your contact is) at hub to coordinate shutdown of AOLserver with postmaster restart -- they're probably rolling their logs. Simply shutdown AOLserver first, then restart postmaster, then restart AOLserver. You do wind up with 30 seconds to a minute of downtime as OpenACS reloads.
This is one of my biggest TODO items for the post-3.5 release of the nspostgres driver.
Was this problem resolved in the 4.0 release of nspostgres? AOLserver hangs whenever the postgres server is restarted or when it stops unexpectedly.