remove volonatry process maximum life time of 600sec (episys?)
This commit is contained in:
@@ -143,21 +143,6 @@ void *memcpy1(void *dst,const void *src,size_t n) {
|
|||||||
|
|
||||||
void set_priority(int priority)
|
void set_priority(int priority)
|
||||||
{
|
{
|
||||||
/* When running with a realtime scheduler, a buggy run-away process can take
|
|
||||||
down the host requiring a reboot to recover. To avoid this scenario, we
|
|
||||||
use alarm(2) to set a maximum running time */
|
|
||||||
unsigned max_runtime_seconds = 10 * 60; /* default */
|
|
||||||
const char *env = getenv("MAX_RUNTIME_SECONDS");
|
|
||||||
if (env != NULL)
|
|
||||||
{
|
|
||||||
max_runtime_seconds = atoi(env);
|
|
||||||
}
|
|
||||||
unsigned was_alarm = alarm(max_runtime_seconds);
|
|
||||||
/* Normally, was_alarm should be 0 indicating there was no previous alarm set.
|
|
||||||
A non-zero value could indicate a mistake */
|
|
||||||
fprintf(stderr, "Set alarm for %u seconds, was %u (see $MAX_RUNTIME_SECONDS)\n",
|
|
||||||
max_runtime_seconds, was_alarm);
|
|
||||||
|
|
||||||
struct sched_param param =
|
struct sched_param param =
|
||||||
{
|
{
|
||||||
.sched_priority = priority,
|
.sched_priority = priority,
|
||||||
|
|||||||
Reference in New Issue
Block a user