summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changes/bug-handle-closed-soledad1
-rw-r--r--src/leap/bitmask/services/soledad/soledadbootstrapper.py9
2 files changed, 9 insertions, 1 deletions
diff --git a/changes/bug-handle-closed-soledad b/changes/bug-handle-closed-soledad
new file mode 100644
index 00000000..bf0a905e
--- /dev/null
+++ b/changes/bug-handle-closed-soledad
@@ -0,0 +1 @@
+- Handle closed Soledad database on quit, speedup exit. Closes #5130.
diff --git a/src/leap/bitmask/services/soledad/soledadbootstrapper.py b/src/leap/bitmask/services/soledad/soledadbootstrapper.py
index 9a292b18..9e797042 100644
--- a/src/leap/bitmask/services/soledad/soledadbootstrapper.py
+++ b/src/leap/bitmask/services/soledad/soledadbootstrapper.py
@@ -20,6 +20,7 @@ Soledad bootstrapping
import logging
import os
import socket
+import sqlite3
import sys
from ssl import SSLError
@@ -348,6 +349,10 @@ class SoledadBootstrapper(AbstractBootstrapper):
# ubuntu folks.
sync_tries -= 1
continue
+ except Exception as e:
+ logger.exception("Unhandled error while syncing "
+ "soledad: %r" % (e,))
+ break
# reached bottom, failed to sync
# and there's nothing we can do...
@@ -435,7 +440,9 @@ class SoledadBootstrapper(AbstractBootstrapper):
except u1db_errors.InvalidGeneration as exc:
logger.error("%r" % (exc,))
raise SoledadSyncError("u1db: InvalidGeneration")
-
+ except sqlite3.ProgrammingError as e:
+ logger.exception("%r" % (e,))
+ raise
except Exception as exc:
logger.exception("Unhandled error while syncing "
"soledad: %r" % (exc,))