Commit e45fd39f authored by Kirill Smelkov's avatar Kirill Smelkov

Y wcfs: Server.stop: Dump kernel traceback of wcfs + lsof + ... if wcfs is stuck

Use Sever._stuckdump we just added for `wcfs status` in the previous
patch to dump that useful information about where wcfs is stuck and
which processes have relation to it.
parent e542211d
......@@ -460,19 +460,22 @@ def __stop(wcsrv, ctx, _onstuck):
return
log.warn("wcfs.go does not exit")
log.warn(wcsrv._stuckdump())
log.warn("-> kill -QUIT wcfs.go ...")
os.kill(wcsrv._proc.pid, SIGQUIT)
if _procwait_(timeoutFrac(0.25), wcsrv._proc):
return
log.warn("wcfs.go does not exit (after SIGQUIT)")
log.warn(wcsrv._stuckdump())
log.warn("-> kill -KILL wcfs.go ...")
os.kill(wcsrv._proc.pid, SIGKILL)
if _procwait_(timeoutFrac(0.25), wcsrv._proc):
return
log.warn("wcfs.go does not exit (after SIGKILL; probably it is stuck in kernel)")
log.warn("-> nothing we can do...") # XXX dump /proc/pid/task/*/stack instead (ignore EPERM)
log.warn(wcsrv._stuckdump())
log.warn("-> nothing we can do...")
if _onstuck is not None:
_onstuck()
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment