From 062d781b734db60d0ae317eaf5b86c7d75abacd9 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Sat, 20 Aug 2016 00:44:02 -0300 Subject: [bug] limit pool comnsumption to 900 docs This was discovered during load tests: Trying to process more than 999 docs triggers an error on SQLite due a select query not supporting 999 values to query. --- client/src/leap/soledad/client/encdecpool.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/src/leap/soledad/client/encdecpool.py b/client/src/leap/soledad/client/encdecpool.py index 2cf5da6e..7be6030e 100644 --- a/client/src/leap/soledad/client/encdecpool.py +++ b/client/src/leap/soledad/client/encdecpool.py @@ -556,6 +556,8 @@ class SyncDecrypterPool(SyncEncryptDecryptPool): while next_index in self._decrypted_docs_indexes: sequence.append(str(next_index)) next_index += 1 + if len(sequence) > 900: + break # SQLITE_LIMIT_VARIABLE_NUMBER # Then fetch all the ones ready for insertion. if sequence: insertable_docs = yield self._get_docs(encrypted=False, -- cgit v1.2.3