FSX / momoko

Wraps (asynchronous) Psycopg2 for Tornado.
http://momoko.61924.nl/
Other
359 stars 73 forks source link

Momoko Pool trying to use dead connections #149

Closed m-novikov closed 6 years ago

m-novikov commented 8 years ago

I'm using momoko 2.2.4 First there were problems with network

File "/usr/lib/python2.7/site-packages/tornado/concurrent.py", line 215, in result
   raise_exc_info(self._exc_info)
File "/usr/lib/python2.7/site-packages/momoko/connection.py", line 484, in when_done
   result = rfut.result()
File "/usr/lib/python2.7/site-packages/tornado/concurrent.py", line 215, in result
  raise_exc_info(self._exc_info)
File "/usr/lib/python2.7/site-packages/momoko/connection.py", line 718, in _io_callback
  state = self.connection.poll()
OperationalError: could not receive data from server: No route to host

And after this all queries started to return this exception

  File "/usr/lib/python2.7/site-packages/momoko/connection.py", line 471, in when_available
    future_or_result = method(conn, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/momoko/connection.py", line 775, in execute
    cursor.execute(operation)
  File "/usr/lib/lib/python2.7/site-packages/psycopg2/extras.py", line 223, in execute
    return super(RealDictCursor, self).execute(query, vars)
ProgrammingError: execute cannot be used while an asynchronous query is underway

ref #51

haizaar commented 7 years ago

Hi,

Can you please provide stand alone reproduction?

m-novikov commented 7 years ago

It appears really hard to reproduce. I suppose it's connected to https://github.com/psycopg/psycopg2/issues/263.

haizaar commented 6 years ago

Closing for now. Please comment if it's still relevant.