in reply to Help on crash in sleep() !

sleep can be interrupted by signals. Maybe your code (or some (C) library it uses) doesn't handle an incoming signal in a good way and the process ends that way?

Can you structure your process in a way that it can be easily restarted by a wrapping shell script or simply reimplement it as a cron job that is run every minute?

Replies are listed 'Best First'.
Re^2: Help on crash in sleep() !
by pcouderc (Monk) on Oct 23, 2015 at 20:39 UTC
    It seems to me that a signal would be possible only if the process would be expecting something, if we were in multithread. This is not the case. We wait 1 minute before checking new work to do. It a simple "polling". Yes it would be possible to wrap it in a main script, but I would like to understand.

      Have you read the documentation link I provided?

      May be interrupted if the process receives a signal such as SIGALRM .

      So, if anything sends a signal to your process, such as SIGALRM, it might wake up or crash.