docker-offlineimap/offlineimap
Nicolas Sebrecht 3c42913120 sqlite: properly serialize operations on the databases
1. There is one database per folder and sqlite requires to serialize the
writings. Instead of locking at LocalStatusSQLiteFolder instance level,
introduce a new DatabaseFileLock object which is shared across threads. This
fixes the concurrent writes issues that some users might experience by
duplications or flags restored to the previous state.

2. Close the database only when we are sure no other threads will use the
connection on a *per-file* basis. Previous fix 677afb8d8f is wrong
because the same lock is shared for all the database files.

Github-fix: https://github.com/OfflineIMAP/offlineimap/issues/350
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-07-26 01:57:25 +02:00
..
folder sqlite: properly serialize operations on the databases 2016-07-26 01:57:25 +02:00
repository sqlite: properly serialize operations on the databases 2016-07-26 01:57:25 +02:00
ui learn to not download UIDs defined by the user 2016-07-03 20:02:45 +02:00
utils Make OS-default CA certificate file to be requested explicitely 2015-01-18 22:05:49 +03:00
__init__.py v7.0.0 2016-07-22 16:56:43 +02:00
accounts.py sqlite: properly serialize operations on the databases 2016-07-26 01:57:25 +02:00
bundled_imaplib2.py bump from imaplib2 v2.53 to v2.55 2016-06-11 11:08:02 +02:00
CustomConfig.py correctly reraise errors with six 2016-07-03 19:56:14 +02:00
emailutil.py Rename email.Parser to email.parser 2016-05-10 02:53:09 +02:00
error.py more consistent style 2015-01-07 21:31:43 +01:00
globals.py fix: when called with -a, mbnames must not erase entries of other accounts 2016-06-25 17:33:42 +02:00
imaplibutil.py improve error message when ssl_version must be set due to the tls_level 2016-07-25 03:29:25 +02:00
imapserver.py improve error message when ssl_version must be set due to the tls_level 2016-07-25 03:29:25 +02:00
imaputil.py Add workaround for string.split for Python3 2016-05-10 02:53:09 +02:00
init.py --info: allow user to enter a password 2016-07-22 01:44:38 +02:00
localeval.py localeval: avoid redefining 'file' keyword 2015-01-14 17:18:48 +01:00
mbnames.py mbnames: fix the filename extension for the intermediate files 2016-07-06 01:15:33 +02:00
threadutil.py threadutil: use 'with' statements for lock 2016-07-03 20:03:14 +02:00
virtual_imaplib2.py bump from imaplib2 v2.53 to v2.55 2016-06-11 11:08:02 +02:00