'How to detect process freeze and restart it
My code will be frozen(≠process down).
I want to detect and restart the frozen process (=stopped process / =zombie process).
Please tell me solutions on this problem.
::My Situation
My code made by python. Target os was linux (However a solution is more better if it works on macos/windows) The codes(process) are managed under supervisord(http://supervisord.org/).
The supervisord can restart the shutdown process, but it seems not to detect and restart the frozen process. (The fact I don't know. However, if supervisord application detect and restart "frozen process", that helps me a lot.)
(And the process calls external process of huge software application. If restart the process, the software application may be needed to be restarted.)
::My solution idea:
The my process writes out to log file every 1-5 sec. So current my solution idea is that I make a new program code that monitors the log data, and if the target process has not write out log, the my new code submit command to restart the process via supervisord.
However, the project was very delayed. So if you know more better solution, please tell me.
:: The cause of the freeze (Added at 5/22 14:57)
I found that the freeze was caused sometimes when a code at each terminal(end of process) in regular cycle calls quit() method of the driver for the external software process.
The quit() -> into logging module process -> logger submitting log to DB -> ... -> a code inside logging call del() of process (process shutdown? in submitting to DB? ) -> silent freeze.
My logger submits logs to DB. In other process, the logger had not fall into freeze, so I could not find the above cause. (I only have not been known to fall in others??). However, if it in the above process, the process causes silent freeze.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
