diff --git a/NEWS b/NEWS index 225f4c1..c1c4381 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +0.9.3 +===== + +* Removed saranwrap as an option for making db connections nonblocking in db_pool. + 0.9.2 ===== diff --git a/eventlet/db_pool.py b/eventlet/db_pool.py index 4fd0c0d..1b1f731 100644 --- a/eventlet/db_pool.py +++ b/eventlet/db_pool.py @@ -236,25 +236,6 @@ class BaseConnectionPool(Pool): self.clear() -class SaranwrappedConnectionPool(BaseConnectionPool): - """A pool which gives out saranwrapped database connections. - """ - def create(self): - return self.connect(self._db_module, - self.connect_timeout, - *self._args, - **self._kwargs) - - @classmethod - def connect(cls, db_module, connect_timeout, *args, **kw): - timeout = api.exc_after(connect_timeout, ConnectTimeout()) - try: - from eventlet import saranwrap - return saranwrap.wrap(db_module).connect(*args, **kw) - finally: - timeout.cancel() - - class TpooledConnectionPool(BaseConnectionPool): """A pool which gives out :class:`~eventlet.tpool.Proxy`-based database connections. diff --git a/tests/db_pool_test.py b/tests/db_pool_test.py index 6cee304..2c37d85 100644 --- a/tests/db_pool_test.py +++ b/tests/db_pool_test.py @@ -448,23 +448,6 @@ class TestTpoolConnectionPool(TestDBConnectionPool): super(TestTpoolConnectionPool, self).tearDown() -class TestSaranwrapConnectionPool(TestDBConnectionPool): - __test__ = False # so that nose doesn't try to execute this directly - def create_pool(self, max_size = 1, max_idle = 10, max_age = 10, connect_timeout= 0.5, module=None): - if module is None: - module = self._dbmodule - return db_pool.SaranwrappedConnectionPool(module, - min_size=0, max_size=max_size, - max_idle=max_idle, max_age=max_age, - connect_timeout=connect_timeout, - **self._auth) - - def test_raising_create(self): - # *TODO: this fails because of saranwrap's unwillingness to - # wrap objects in tests, but it should be fixable - pass - - class TestRawConnectionPool(TestDBConnectionPool): __test__ = False # so that nose doesn't try to execute this directly def create_pool(self, max_size = 1, max_idle = 10, max_age = 10, connect_timeout= 0.5, module=None): @@ -477,7 +460,7 @@ class TestRawConnectionPool(TestDBConnectionPool): **self._auth) def test_connection_timeout(self): - pass # not gonna work for raw connections because they're not nonblocking + pass # not gonna work for raw connections because they're blocking def get_auth(): @@ -535,14 +518,10 @@ class TestMysqlConnectionPool(object): del db -# for some reason the tpool test hangs if run after the saranwrap test class Test01MysqlTpool(TestMysqlConnectionPool, TestTpoolConnectionPool, TestCase): pass -class Test02MysqlSaranwrap(TestMysqlConnectionPool, TestSaranwrapConnectionPool, TestCase): - pass - -class Test03MysqlRaw(TestMysqlConnectionPool, TestRawConnectionPool, TestCase): +class Test02MysqlRaw(TestMysqlConnectionPool, TestRawConnectionPool, TestCase): pass