Detecting image (pharo process) hang?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Detecting image (pharo process) hang?

StormByte
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?


Reply | Threaded
Open this post in threaded view
|

Re: Detecting image (pharo process) hang?

drush66
On Wed, Jun 3, 2015 at 11:51 AM, David <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: Detecting image (pharo process) hang?

StormByte
El Wed, 3 Jun 2015 11:55:17 +0200
Davorin Rusevljan
<[hidden email]> escribió:

> On Wed, Jun 3, 2015 at 11:51 AM, David
> <[hidden email]> 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.



Reply | Threaded
Open this post in threaded view
|

Re: Detecting image (pharo process) hang?

Stephan Eggermont-3
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



Reply | Threaded
Open this post in threaded view
|

Re: Detecting image (pharo process) hang?

Adventurer
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

Reply | Threaded
Open this post in threaded view
|

Re: Detecting image (pharo process) hang?

StormByte
In reply to this post by Stephan Eggermont-3
El Wed, 03 Jun 2015 12:33:16 +0200
Stephan Eggermont <[hidden email]> 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.