From 45f442f7c3813e8525b33bbbcc0ead062468fd28 Mon Sep 17 00:00:00 2001 From: "Georgios D. Tsoukalas" Date: Tue, 11 Sep 2012 14:10:59 +0300 Subject: [PATCH] cleanup pithos backend pools, new pool api support --- snf-pithos-app/pithos/api/util.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/snf-pithos-app/pithos/api/util.py b/snf-pithos-app/pithos/api/util.py index fc10f42..f8233f9 100644 --- a/snf-pithos-app/pithos/api/util.py +++ b/snf-pithos-app/pithos/api/util.py @@ -822,6 +822,9 @@ class PithosBackendPool(ObjectPool): backend._use_count = USAGE_LIMIT return backend + def _pool_verify(self, backend): + return 1 + def _pool_cleanup(self, backend): c = backend._use_count - 1 if c < 0: @@ -829,6 +832,10 @@ class PithosBackendPool(ObjectPool): return True backend._use_count = c + if backend.trans is not None: + backend.wrapper.rollback() + if backend.messages: + backend.messages = [] return False _pithos_backend_pool = PithosBackendPool(size=POOL_SIZE) -- 1.7.10.4