summaryrefslogtreecommitdiffstats
path: root/common/datastorequery.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-02-15 10:19:08 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-02-15 11:08:52 +0100
commit531972042d4b610258c8af8a17ec3a99cd063dda (patch)
treeef4356ec141f0f1ccd756e8610b08553b866bf78 /common/datastorequery.h
parentf51963f057bcbdd175114433913a1c5f0eebd546 (diff)
downloadsink-531972042d4b610258c8af8a17ec3a99cd063dda.tar.gz
sink-531972042d4b610258c8af8a17ec3a99cd063dda.zip
Fixed crashes due to concurrently running queries.
A single QueryRunner should never have multiple workers running at the same time. We did not properly enforce this in case of incremental updates coming in. The only way I managed to reproduce the crash: * Open a large folder with lots of unread mail in kube * Select a mail in the maillist and hold the down button * This will: * Repeatedly call fetch more * Trigger lot's of mark as read modifications that result in notifications. * Eventually it crashes somewhere in EntityStore, likely because of concurrent access of the filter structure which is shared through the state. We now ensure in the single threaded portion of the code that we only ever run one worker at a time. If we did receive an update during, we remember that change and fetch more once we're done. To be able to call fetch again that portion was also factored out into a separate function.
Diffstat (limited to 'common/datastorequery.h')
-rw-r--r--common/datastorequery.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/datastorequery.h b/common/datastorequery.h
index cc501e6..8800644 100644
--- a/common/datastorequery.h
+++ b/common/datastorequery.h
@@ -115,7 +115,7 @@ public:
115 virtual void updateComplete() { } 115 virtual void updateComplete() { }
116 116
117 FilterBase::Ptr mSource; 117 FilterBase::Ptr mSource;
118 DataStoreQuery *mDatastore; 118 DataStoreQuery *mDatastore{nullptr};
119 bool mIncremental = false; 119 bool mIncremental = false;
120}; 120};
121 121