I expect the bare raise is here (sqlalchemy/pool.py). Pretty sure self.invalidate is making socket connections, so the exception is getting eaten by eventlet. I'm trying to investigate if there is a way to make eventlet not clear exception info. This could be especially dangerous if the higher level code is trying to catch a specific type of exception. Might be worth it to try one of the following things:
1) Try to make eventlet stop eating exception info:
diff -r f30a2fa65f30 eventlet/hubs/hub.py
--- a/eventlet/hubs/hub.py Wed Jun 08 23:47:26 2011 -0700
+++ b/eventlet/hubs/hub.py Sat Sep 24 05:04:30 2011 -0700
@@ -173,7 +173,7 @@ cur.parent = self.greenlet
except ValueError:
pass # gets raised if there is a greenlet parent cycle
- clear_sys_exc_info()
+ #clear_sys_exc_info()
return self.greenlet.switch()
def squelch_exception(self, fileno, exc_info):
or 2) modify the above code to reraise the exception
diff --git a/Library/Python/2.7/site-packages/sqlalchemy/pool.py b/pool.py
index 632d955..21e7055 100644
--- a/Library/Python/2.7/site-packages/sqlalchemy/pool.py
+++ b/pool.py
@@ -383,8 +383,10 @@ class _ConnectionFairy(object):
c = self.connection.cursor(*args, **kwargs)
return _CursorFairy(self, c)
except Exception, e:
+ import sys
+ exc = sys.exc_info() self.invalidate(e=e)
- raise
+ raise exc
381 def cursor(self, *args, **kwargs): .cursor( *args, **kwargs) (e=e)
382 try:
383 c = self.connection
384 return _CursorFairy(self, c)
385 except Exception, e:
386 self.invalidate
387 raise
I expect the bare raise is here (sqlalchemy/ pool.py) . Pretty sure self.invalidate is making socket connections, so the exception is getting eaten by eventlet. I'm trying to investigate if there is a way to make eventlet not clear exception info. This could be especially dangerous if the higher level code is trying to catch a specific type of exception. Might be worth it to try one of the following things:
1) Try to make eventlet stop eating exception info:
diff -r f30a2fa65f30 eventlet/ hubs/hub. py hubs/hub. py Wed Jun 08 23:47:26 2011 -0700 hubs/hub. py Sat Sep 24 05:04:30 2011 -0700
cur. parent = self.greenlet exc_info( ) sys_exc_ info() switch( )
--- a/eventlet/
+++ b/eventlet/
@@ -173,7 +173,7 @@
except ValueError:
pass # gets raised if there is a greenlet parent cycle
- clear_sys_
+ #clear_
return self.greenlet.
def squelch_ exception( self, fileno, exc_info):
or 2) modify the above code to reraise the exception
diff --git a/Library/ Python/ 2.7/site- packages/ sqlalchemy/ pool.py b/pool.py Python/ 2.7/site- packages/ sqlalchemy/ pool.py y(object) : .cursor( *args, **kwargs)
self. invalidate( e=e)
index 632d955..21e7055 100644
--- a/Library/
+++ b/pool.py
@@ -383,8 +383,10 @@ class _ConnectionFair
c = self.connection
return _CursorFairy(self, c)
except Exception, e:
+ import sys
+ exc = sys.exc_info()
- raise
+ raise exc
def __getattr__(self, key): self.connection , key)
return getattr(
I will do some more investigation into this when I can. We need a clear repro case for this.