diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2017-12-15 21:16:24 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2017-12-15 21:16:27 +0000 |
commit | bc89387e3d9cf32603213ca26bdfe3df1dd9c526 (patch) | |
tree | 180f294d2ac97d641f0266216ffdc328db9bfef8 /configd/src | |
parent | 77242dcd5594b4b481403491c47979cc866a569c (diff) |
only run pstack once
* otherwise, any useful information is likely to be
overwritten when very large processes take some time to exit
Diffstat (limited to 'configd/src')
-rw-r--r-- | configd/src/apps/sentinel/service.cpp | 4 |
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, |