summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2017-09-01 09:50:11 -0300
committerdrebs <drebs@riseup.net>2017-09-05 11:17:46 -0300
commit4d9fbf01b7fc9c0da8c2e267945d10af3837f161 (patch)
tree53d9c1aa54b0ce7d57e7fd80fa949315f54045bc
parent3a09cef55a59681ae3799c69d160f6f89356921d (diff)
[bug] ensure the number of threads in blobs thread pool
The number of threads in the blobs databae thread pool can't be smaller than the number of attemps to write concurrently to the database, otherwise different kinds of concurrency problems may arise. By setting the minimum and maximum number of threads to the same number, we make sure there will always be that number of available threads for interaction with the blobs db.
-rw-r--r--src/leap/soledad/client/_db/blobs.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/leap/soledad/client/_db/blobs.py b/src/leap/soledad/client/_db/blobs.py
index 7015ae5b..ada72475 100644
--- a/src/leap/soledad/client/_db/blobs.py
+++ b/src/leap/soledad/client/_db/blobs.py
@@ -425,7 +425,7 @@ class SQLiteBlobBackend(object):
self.dbpool = ConnectionPool(
backend, self.path, check_same_thread=False, timeout=5,
- cp_openfun=openfun, cp_min=1, cp_max=2, cp_name='blob_pool')
+ cp_openfun=openfun, cp_min=2, cp_max=2, cp_name='blob_pool')
def close(self):
from twisted._threads import AlreadyQuit