diff options
author | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2020-07-13 08:54:15 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2020-07-13 09:04:50 +0000 |
commit | ccc59fb7598ee714d0119e7e8de39699e467603c (patch) | |
tree | 149b1086d83e9e7e14e0dc81d1658f757e89926b /searchcore/src/apps/proton/proton.cpp | |
parent | 9baa67e082830e31e47b2881737351cb1828d64f (diff) |
Shutdown state server and metric manager before service layer
Avoids a very small race condition window where metric update hooks
may point into the service layer components even after they have
been destroyed, as these are not explicitly unregistered today.
Another option would be to add unregistering on component destruction,
but that adds another race condition where an external client may
observe partial metric existence during this time window. By shutting
down the metric exporting interfaces first, we should avoid this.
Diffstat (limited to 'searchcore/src/apps/proton/proton.cpp')
-rw-r--r-- | searchcore/src/apps/proton/proton.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/searchcore/src/apps/proton/proton.cpp b/searchcore/src/apps/proton/proton.cpp index 8709b0d01b1..bc4329eadf6 100644 --- a/searchcore/src/apps/proton/proton.cpp +++ b/searchcore/src/apps/proton/proton.cpp @@ -252,6 +252,9 @@ App::Main() } } } + // Ensure metric manager and state server are shut down before we start tearing + // down any service layer components that they may end up transitively using. + protonUP->perform_pre_service_layer_shutdown_steps(); if (spiProton) { spiProton->getNode().requestShutdown("controlled shutdown"); spiProton->shutdown(); |