<p>Well I've worked around it by reducing the tcp heartbeat to 10 minutes in /etc/sysctl.conf and reducing the idle client timeout in postgresqls configuration.<br>
But yes there is an issue with this.<br>
I think it the monitoring that does it but I'm not sure. I can tell you the incidents of it do go up with monitoring turned on.<br>
The problem is is seems like its a shared library that isn't logging if the class goes out of scope out of the database correctly that make tracking the root cause significantly harder.<br>
I'm not familiar enough with python to figure explain how it should be fixed but in perl the DBI driver had. DESTROY method that catches if the programer forgot to logout of the database before the instance of the class goes out of scope or the application exits. It seems to me this is missing from the python postgresql driver and if that functionality could be added it would resolve the issue.</p>

<div class="gmail_quote">On May 11, 2012 6:13 PM, "Scott Piazza" <<a href="mailto:scott.piazza@bespokess.com">scott.piazza@bespokess.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I recently upgraded from Spacewalk 1.6 to 1.7.  In this version, I am<br>
seeing an issue where Spacewalk works fine for several hours, but then<br>
the database runs out of connections, and Spacewalk begins throwing<br>
errors.  Similar Postgresql errors on other forums try to blame the<br>
application for not closing connections correctly.  Older Spacewalk<br>
posts online seem to suggest there's an issue with osa-dispatcher that<br>
might be causing it.  I have disabled osa-dispatcher for now and am<br>
waiting to see if that helps narrow down the source of the problem.<br>
However, if anyone has additional suggestions to get this fixed, I would<br>
appreciate hearing them.<br>
<br>
<br>
Server: CentOS 6.2<br>
Spacwalk: 1.7<br>
SELinux: off<br>
PostgreSQL: 8.4.9-1.el6_1.1<br>
Postgres max connections: 500<br>
<br>
/var/log/rhn/rhn_server_xmlrpc.log:<br>
2012/05/10 12:17:50 -07:00 29438 <a href="http://10.0.11.2" target="_blank">10.0.11.2</a>:<br>
rhnSQL/driver_postgresql.check_connection('ERROR', "DATABASE CONNECTION<br>
TO 'whmgmt' LOST", "Exception information: Database instance has no<br>
attribute 'dbh'")<br>
<br>
/var/log/rhn/osa-dispatcher.log:<br>
2012/05/10 08:14:09 -07:00 10255 <a href="http://0.0.0.0" target="_blank">0.0.0.0</a>:<br>
rhnSQL/driver_postgresql.check_connection('ERROR', "DATABASE CONNECTION<br>
TO 'whmgmt' LOST", 'Exception information: server closed the connection<br>
unexpectedly\n\tThis probably means the server terminated abnormally\n<br>
\tbefore or while processing the request.\n')<br>
<br>
/var/lib/pgsql/data/pg_log/logfile.log:<br>
2012-05-10 17:50:47 MST - whmgmtuser - [local]: FATAL:  sorry, too many<br>
clients already<br>
2012-05-10 17:50:49 MST - whmgmtuser - <a href="http://127.0.0.1" target="_blank">127.0.0.1</a>: LOG:  unexpected EOF<br>
on client connection<br>
2012-05-10 17:51:13 MST - whmgmtuser - [local]: LOG:  could not send<br>
data to client: Broken pipe<br>
<br>
<br>
_______________________________________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank">https://www.redhat.com/mailman/listinfo/spacewalk-list</a><br>
</blockquote></div>