summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2019-03-29 13:47:52 +0000
committerArne Juul <arnej@yahoo-inc.com>2019-04-01 08:42:43 +0000
commitabd5b8fc212ba82e0a90ae802df6b27856dbfd24 (patch)
treeffdf4035d24d0c2acc95480b7cb327ead041fda8 /searchcore
parentb012478bd6aed5cf4d2f62854b6d800b8c020b0e (diff)
handle shutdown before config is available
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
index 8aef8d51c5f..8333911d7d9 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
@@ -436,7 +436,15 @@ Proton::~Proton()
if (_fs4Server) {
_fs4Server->shutDown();
}
- size_t numCores = _protonConfigurer.getActiveConfigSnapshot()->getBootstrapConfig()->getHwInfo().cpu().cores();
+ // size_t numCores = _protonConfigurer.getActiveConfigSnapshot()->getBootstrapConfig()->getHwInfo().cpu().cores();
+ size_t numCores = 4;
+ const std::shared_ptr<proton::ProtonConfigSnapshot> pcsp = _protonConfigurer.getActiveConfigSnapshot();
+ if (pcsp) {
+ const std::shared_ptr<proton::BootstrapConfig> bcp = pcsp->getBootstrapConfig();
+ if (bcp) {
+ numCores = bcp->getHwInfo().cpu().cores();
+ }
+ }
vespalib::ThreadStackExecutor closePool(std::min(_documentDBMap.size(), numCores), 0x20000, close_executor);
closeDocumentDBs(closePool);
_documentDBMap.clear();