Detecting image (pharo process) hang?
I am making a little watchdog (in C++) for spawning forked pharo image processes and detecting when they crash (for ex, memory exhausted and/or killed) so it can restart the image. It works, but for now I have only 1 remaining thing: How can I detect from outside, when pharo process is hanged and not responsive? I am thinking something like sending SIGUSR1 (which should output a backtrace) and if nothing is produced, then kill the pid. The problem is that when I do so, then image is completelly unresponsive (all is blank and not responsive to any event, click and so). Is there anything better?
On Wed, Jun 3, 2015 at 11:51 AM, David <stormbyte@gmail.com> wrote:
I am making a little watchdog (in C++) for spawning forked pharo image processes and detecting when they crash (for ex, memory exhausted and/or killed) so it can restart the image.
It works, but for now I have only 1 remaining thing:
How can I detect from outside, when pharo process is hanged and not responsive?
I am thinking something like sending SIGUSR1 (which should output a backtrace) and if nothing is produced, then kill the pid.
The problem is that when I do so, then image is completelly unresponsive (all is blank and not responsive to any event, click and so).
Is there anything better?
Install minimal http server into image, and query it for basic health information? Davorin Rusevljan http://www.cloud208.com/
El Wed, 3 Jun 2015 11:55:17 +0200 Davorin Rusevljan <davorin.rusevljan@gmail.com> escribió:
On Wed, Jun 3, 2015 at 11:51 AM, David <stormbyte@gmail.com> wrote:
I am making a little watchdog (in C++) for spawning forked pharo image processes and detecting when they crash (for ex, memory exhausted and/or killed) so it can restart the image.
It works, but for now I have only 1 remaining thing:
How can I detect from outside, when pharo process is hanged and not responsive?
I am thinking something like sending SIGUSR1 (which should output a backtrace) and if nothing is produced, then kill the pid.
The problem is that when I do so, then image is completelly unresponsive (all is blank and not responsive to any event, click and so).
Is there anything better?
Install minimal http server into image, and query it for basic health information?
Davorin Rusevljan http://www.cloud208.com/
That could work, but can be time expensive. I already have seaside installed (and I am using that) so I may try that. The only problem I see if that if the image is stalled, it can pass more time than desired until it times out the http connection. But thanks, I will try something like that.
On 03-06-15 12:07, David wrote:
That could work, but can be time expensive. I already have seaside installed (and I am using that) so I may try that.
The only problem I see if that if the image is stalled, it can pass more time than desired until it times out the http connection.
Add a keep-alive server, sending an UDP packet every so often? Stephan
On 03-06-15 12:07, David wrote:
That could work, but can be time expensive. I already have seaside installed (and I am using that) so I may try that.
The only problem I see if that if the image is stalled, it can pass more time than desired until it times out the http connection. Use threads, one to start the session and set a flag on receiving a response and a second to watch for the flag. If there's no flag after a second, the VM is a gonner.
Craig
El Wed, 03 Jun 2015 12:33:16 +0200 Stephan Eggermont <stephan@stack.nl> escribió:
On 03-06-15 12:07, David wrote:
That could work, but can be time expensive. I already have seaside installed (and I am using that) so I may try that.
The only problem I see if that if the image is stalled, it can pass more time than desired until it times out the http connection.
Add a keep-alive server, sending an UDP packet every so often?
Stephan
I thought on wget -T 1 -t 1 localhost:xxxx, for a blank page, 1 second is already more than enough to wait, so if the return status is != 0, I can know it crashed.
participants (4)
-
Craig Johnson -
David -
Davorin Rusevljan -
Stephan Eggermont