Bug reported in the sqlalchmey issue tracker but from @zzzeek's point of view, it's pymysql side bug. This will cause a serious bug "transaction partial succeeding" when greenlet timed out and killed by gevent. Original issue here: https://bitbucket.org/zzzeek/sqlalchemy/issue/3258/a-gevent-killed-greenlet-causes-pymysql Reproduce script: - https://gist.github.com/lxyu/4e14021e4bae7bc26da7 - https://gist.github.com/zzzeek/947337f44d70fac537be