起初。我的项目使用sqlalchemy==0.9.3
和gunicorn==19.3.0
。它运行得很完美。
最近,我将sqlalchemy升级到1.0.4。然后,存在一些例外。
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>)
有人可以提供帮助吗?非常感谢。