aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@yahooinc.com>2022-05-02 16:26:51 +0200
committerGitHub <noreply@github.com>2022-05-02 16:26:51 +0200
commit8c5dd0899ed02ceb849cac072a872af70b037778 (patch)
treedb319ed801fee06866ad7003ba2986bebf5b292a
parentc8635c55ff8b7a7481c5d1158f7fd04d2f5d09a0 (diff)
parent60858efdde6aa2c741fae306ac7266e4c3835c61 (diff)
Merge pull request #22385 from vespa-engine/vekterli/require-state-lock-before-checking-fields
Reacquire state lock before checking if any fields were set by the state listener
-rw-r--r--storage/src/vespa/storage/storageserver/statemanager.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/storage/src/vespa/storage/storageserver/statemanager.cpp b/storage/src/vespa/storage/storageserver/statemanager.cpp
index 7cb66ab447f..60aebf5a535 100644
--- a/storage/src/vespa/storage/storageserver/statemanager.cpp
+++ b/storage/src/vespa/storage/storageserver/statemanager.cpp
@@ -272,8 +272,9 @@ StateManager::notifyStateListeners()
}
for (auto* listener : _stateListeners) {
listener->handleNewState();
- // If one of them actually altered the state again, abort
- // sending events, update states and send new one to all.
+ // If one of them actually altered the state again, abort
+ // sending events, update states and send new one to all.
+ std::lock_guard guard(_stateLock);
if (_nextNodeState || _nextSystemState) {
break;
}