Browse Source

[core] restart dead piped loggers every 64 sec

(when piped logger exited too quickly after being restarted
 and when server.max-worker = 0)
personal/stbuehler/ci-build
Glenn Strauss 2 years ago
parent
commit
3f7779d247
  1. 2
      src/fdevent.c
  2. 9
      src/server.c

2
src/fdevent.c

@ -875,7 +875,7 @@ int fdevent_reaped_logger_pipe(pid_t pid) {
if (fcp->start + 5 < ts) { /* limit restart to once every 5 sec */
fcp->start = ts;
fcp->pid = fdevent_open_logger_pipe_spawn(fcp->cmd,fcp->fds[0]);
return 1;
return (fcp->pid > 0) ? 1 : -1;
}
else {
fcp->pid = -1;

9
src/server.c

@ -1423,8 +1423,13 @@ static void server_handle_sigalrm (server * const srv, time_t min_ts, time_t las
}
#endif
/* free excess chunkqueue buffers every 64 seconds */
if (0 == (min_ts & 0x3f)) chunkqueue_chunk_pool_clear();
if (0 == (min_ts & 0x3f)) { /*(once every 64 secs)*/
/* free excess chunkqueue buffers every 64 secs */
chunkqueue_chunk_pool_clear();
/* attempt to restart dead piped loggers every 64 secs */
if (0 == srv->srvconf.max_worker)
fdevent_restart_logger_pipes(min_ts);
}
/* cleanup stat-cache */
stat_cache_trigger_cleanup();
/* reset global/aggregate rate limit counters */

Loading…
Cancel
Save