Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

With pooling, continues to use closed connections after postgres restart. #164

Open
PriceChild opened this Issue · 0 comments

1 participant

@PriceChild

After restarting postgresql, web.py under mod_wsgi with pooling enabled, all further requests of my application which required the database failed. Here's a section of my ssl_error_log with my application specific stuff snipped:

[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx] Traceback (most recent call last):
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]   File "/usr/lib/python2.4/site-packages/web/application.py", line 237, in process
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]     return self.handle()
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]   File "/usr/lib/python2.4/site-packages/web/application.py", line 228, in handle
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]     return self._delegate(fn, self.fvars, args)
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]   File "/usr/lib/python2.4/site-packages/web/application.py", line 409, in _delegate
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]     return handle_class(cls)
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]   File "/usr/lib/python2.4/site-packages/web/application.py", line 385, in handle_class
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]     return tocall(*args)
*snip*
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]   File "/usr/lib/python2.4/site-packages/web/db.py", line 682, in select
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]     return self.query(qout, processed=True)
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]   File "/usr/lib/python2.4/site-packages/web/db.py", line 643, in query
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]     db_cursor = self._db_cursor()
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]   File "/usr/lib/python2.4/site-packages/web/db.py", line 566, in _db_cursor
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]     return self.ctx.db.cursor()
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]   File "/usr/lib/python2.4/site-packages/web/db.py", line 507, in _getctx
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]     self._load_context(self._ctx)
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]   File "/usr/lib/python2.4/site-packages/web/db.py", line 516, in _load_context
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]     ctx.db = self._connect_with_pooling(self.keywords)
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]   File "/usr/lib/python2.4/site-packages/web/db.py", line 970, in _connect_with_pooling
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]     conn._con._con.set_client_encoding('UTF8')
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx] InterfaceError: connection already closed
[Wed Jul 04 23:17:29 2012] [error] [client xxx.xxx.xxx.xxx]

Googling shows this problem with several other projects such as FSX/momoko#11 / FSX/momoko@d63248b so I'm hoping we simply need a similar solution. I'll see what I can do.

edit: annoyingly I don't seem to be able to reproduce this, the pooling successfully opens new connections. Surely its not due to me using ssl & non-ssl in production..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.