exception in sqlalchemy with gevent

901 views Asked by At

At first. my project use sqlalchemy==0.9.3 with gunicorn==19.3.0. it runs perfect.

Recently, i upgrade the sqlalchemy into 1.0.4. then, there exist some exception.

ERROR  sqlalchemy.pool.QueuePool[101946]:[myproj]pool => _finalize_fairy Exception during reset or similar
Traceback (most recent call last):
  File "/srv/virtualenvs/myprojenv/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 631, in _finalize_fairy
    fairy._reset(pool)
  File "/srv/virtualenvs/myprojenv/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 765, in _reset
    pool._dialect.do_rollback(self)
  File "/srv/virtualenvs/myprojenv/local/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/base.py", line 2519, in do_rollback
    dbapi_connection.rollback()
  File "/srv/virtualenvs/myprojenv/local/lib/python2.7/site-packages/pymysql/connections.py", line 711, in rollback
    self._read_ok_packet()
  File "/srv/virtualenvs/myprojenv/local/lib/python2.7/site-packages/pymysql/connections.py", line 685, in _read_ok_packet
    pkt = self._read_packet()
  File "/srv/virtualenvs/myprojenv/local/lib/python2.7/site-packages/pymysql/connections.py", line 882, in _read_packet
    packet_header = self._read_bytes(4)
  File "/srv/virtualenvs/myprojenv/local/lib/python2.7/site-packages/pymysql/connections.py", line 899, in _read_bytes
    data = self._rfile.read(num_bytes)
  File "/srv/virtualenvs/myprojenv/local/lib/python2.7/site-packages/pymysql/_socketio.py", line 59, in readinto
    return self._sock.recv_into(b)
  File "/srv/virtualenvs/myprojenv/local/lib/python2.7/site-packages/gevent/socket.py", line 428, in recv_into
    self._wait(self._read_event)
  File "/srv/virtualenvs/myprojenv/local/lib/python2.7/site-packages/gevent/socket.py", line 298, in _wait
    self.hub.wait(watcher)
  File "/srv/virtualenvs/myprojenv/local/lib/python2.7/site-packages/gevent/hub.py", line 342, in wait
    assert result is unique, 'Invalid switch into %s: %r (expected %r)' % (getcurrent(), result, unique)
AssertionError: Invalid switch into <Greenlet at 0x7f6fedf28730: <functools.partial object at 0x7f6fee2eb470>(<socket at 0x7f6fee0b1550 fileno=25 sock=127.0.0.1, ('127.0.0.1', 40742))>: <gevent.event.AsyncResult object at 0x7f6fedeaed50> (expected <object object at 0x7f6fedf84b60>)

Is there anyone can help? Thanks very much.

0

There are 0 answers