Commit 8590e148 authored by Georgios D. Tsoukalas's avatar Georgios D. Tsoukalas
Browse files

pithos: don't crash in sqlite backend pools

parent 044a616e
......@@ -120,13 +120,18 @@ class PithosBackendPool(ObjectPool):
try:
fd = conn.connection.connection.fileno()
r, w, x = select([fd], (), (), 0)
if r:
conn.close()
except AttributeError:
# probably sqlite, assume success
pass
else:
try:
r, w, x = select([fd], (), (), 0)
if r:
conn.close()
return False
except:
print_exc()
return False
except:
print_exc()
return False
return True
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment