summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-01-28 10:33:35 +0000
committerTor Brede Vekterli <vekterli@yahooinc.com>2022-01-28 10:33:35 +0000
commitecfc1d6830891cbbd39c71cf9f64d2ecd8b03c7f (patch)
tree343430e8ed64e95d47581832eb147a83bd666c60 /storage
parent4ecf28139f846c1c16dfdc085031445ee8bb5029 (diff)
Avoid assertion failure on aborted node startup
If a node fails to completely start up due to e.g. failures fetching bootstrap config, it's possible for the storage component chain to have been created but not yet completely initialized. Attempts to gracefully abort startup will still invoke the component `onClose()` methods, at which point the components must be able to handle a partially initialized state. Let `ModifiedBucketChecker` handle that its worker thread was not created when closing, as this will happen when `onOpen()` is never called.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/persistence/filestorage/modifiedbucketchecker.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/storage/src/vespa/storage/persistence/filestorage/modifiedbucketchecker.cpp b/storage/src/vespa/storage/persistence/filestorage/modifiedbucketchecker.cpp
index 3ad34a94726..90f7f292a6d 100644
--- a/storage/src/vespa/storage/persistence/filestorage/modifiedbucketchecker.cpp
+++ b/storage/src/vespa/storage/persistence/filestorage/modifiedbucketchecker.cpp
@@ -97,7 +97,9 @@ ModifiedBucketChecker::onClose()
if (_singleThreadMode) {
return;
}
- assert(_thread);
+ if (!_thread) {
+ return; // Aborted startup; onOpen() was never called so there's nothing to close.
+ }
LOG(debug, "Interrupting modified bucket checker thread");
_thread->interrupt();
_cond.notify_one();