aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-12-15 22:52:20 +0100
committerGitHub <noreply@github.com>2017-12-15 22:52:20 +0100
commit3b7eb640c341208423e4942d4edf3acbd074819b (patch)
tree180f294d2ac97d641f0266216ffdc328db9bfef8
parent77242dcd5594b4b481403491c47979cc866a569c (diff)
parentbc89387e3d9cf32603213ca26bdfe3df1dd9c526 (diff)
Merge pull request #4456 from vespa-engine/arnej/only-pstack-once
only run pstack once
-rw-r--r--configd/src/apps/sentinel/service.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/configd/src/apps/sentinel/service.cpp b/configd/src/apps/sentinel/service.cpp
index 3c762a957ec..5633c356bc7 100644
--- a/configd/src/apps/sentinel/service.cpp
+++ b/configd/src/apps/sentinel/service.cpp
@@ -113,8 +113,7 @@ Service::terminate(bool catchable, bool dumpState)
ret == 0 ? "OK" : strerror(errno));
return ret;
} else {
- setState(KILLING);
- if (dumpState) {
+ if (dumpState && _state != KILLING) {
vespalib::string pstackCmd = make_string("pstack %d > %s/%s.pstack.%d",
_pid, getVespaTempDir().c_str(), name().c_str(), _pid);
LOG(info, "%s:%d failed to stop. Stack dumped at %s", name().c_str(), _pid, pstackCmd.c_str());
@@ -123,6 +122,7 @@ Service::terminate(bool catchable, bool dumpState)
LOG(warning, "'%s' failed with return value %d", pstackCmd.c_str(), pstackRet);
}
}
+ setState(KILLING);
kill(_pid, SIGCONT); // if it was stopped for some reason
int ret = kill(_pid, SIGKILL);
LOG(debug, "%s: kill -SIGKILL %d: %s", name().c_str(), (int)_pid,