/*
- * $Id: helper.cc,v 1.63 2004/12/22 15:05:09 serassio Exp $
+ * $Id: helper.cc,v 1.64 2004/12/22 15:10:37 serassio Exp $
*
* DEBUG: section 84 Helper process maintenance
* AUTHOR: Harvest Derived?
comm_read(srv->rfd, srv->rbuf, srv->rbuf_sz - 1, helperHandleRead, srv);
}
+ hlp->last_restart = squid_curtime;
safe_free(shortname);
safe_free(procname);
helperKickQueue(hlp);
}
+ hlp->last_restart = squid_curtime;
safe_free(shortname);
safe_free(procname);
helperStatefulKickQueue(hlp);
debug(84, 0) ("WARNING: %s #%d (FD %d) exited\n",
hlp->id_name, srv->index + 1, fd);
- if (hlp->n_active < hlp->n_to_start / 2)
- fatalf("Too few %s processes are running\n", hlp->id_name);
+ if (hlp->n_active < hlp->n_to_start / 2) {
+ debug(80, 0) ("Too few %s processes are running\n", hlp->id_name);
+
+ if (hlp->last_restart > squid_curtime - 30)
+ fatalf("The %s helpers are crashing too rapidly, need help!\n", hlp->id_name);
+
+ debug(80, 0) ("Starting new helpers\n");
+
+ helperOpenServers(hlp);
+ }
}
cbdataReferenceDone(srv->parent);
debug(84, 0) ("WARNING: %s #%d (FD %d) exited\n",
hlp->id_name, srv->index + 1, fd);
- if (hlp->n_active < hlp->n_to_start / 2)
- fatalf("Too few %s processes are running\n", hlp->id_name);
+ if (hlp->n_active <= hlp->n_to_start / 2) {
+ debug(80, 0) ("Too few %s processes are running\n", hlp->id_name);
+
+ if (hlp->last_restart > squid_curtime - 30)
+ fatalf("The %s helpers are crashing too rapidly, need help!\n", hlp->id_name);
+
+ debug(80, 0) ("Starting new helpers\n");
+
+ helperStatefulOpenServers(hlp);
+ }
}
if (srv->data != NULL)