aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-10-30 22:10:37 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-10-30 22:10:37 +0000
commit1f8fee87bc5331bfccbb1bde684d0f6172ae20cb (patch)
treee87523af15cfe94364719c0b2be480629142f8b2 /searchcore
parentf5b129f06546eb0770d6f74c049860d5b2fcb282 (diff)
Repeat sync twice.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp13
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h1
3 files changed, 11 insertions, 4 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
index c6708500390..f509bcf31ef 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
@@ -895,7 +895,6 @@ DocumentDB::syncFeedView()
IFeedView::SP newFeedView(_subDBs.getFeedView());
_writeService.sync();
- _writeService.sync(); // Needs a second sync as more task might be posted
_feedView.set(newFeedView);
_feedHandler->setActiveFeedView(newFeedView.get());
diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
index b29dd955ff3..0559ac2afba 100644
--- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
@@ -53,8 +53,16 @@ ExecutorThreadingService::ExecutorThreadingService(vespalib::SyncableThreadExecu
ExecutorThreadingService::~ExecutorThreadingService() = default;
vespalib::Syncable &
-ExecutorThreadingService::sync()
-{
+ExecutorThreadingService::sync() {
+ // We have multiple patterns where task A posts to B which post back to A
+ for (size_t i = 0; i < 2; i++) {
+ syncOnce();
+ }
+ return *this;
+}
+
+void
+ExecutorThreadingService::syncOnce() {
bool isMasterThread = _masterService.isCurrentThread();
if (!isMasterThread) {
_masterExecutor.sync();
@@ -67,7 +75,6 @@ ExecutorThreadingService::sync()
if (!isMasterThread) {
_masterExecutor.sync();
}
- return *this;
}
void
diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h
index 280e50aea56..1561f5d6adc 100644
--- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h
+++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h
@@ -28,6 +28,7 @@ private:
std::unique_ptr<vespalib::ISequencedTaskExecutor> _indexFieldWriter;
std::unique_ptr<vespalib::ISequencedTaskExecutor> _attributeFieldWriter;
+ void syncOnce();
public:
using OptimizeFor = vespalib::Executor::OptimizeFor;
/**