Change delay between subsequent socket reinitialization attempts from 1000 usec
to 1000 ms. Such frequent attempts were affecting collectd functionality and
flooded the syslog. Issue can be eaisly reproduced by stopping mcelog service
while collectd with mcelog plugin enabled is running.
Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
pthread_cleanup_push(poll_worker_cleanup, pp_file);
while (1) {
- int res = 0;
/* blocking call */
- res = socket_adapter.receive(&socket_adapter, pp_file);
+ int res = socket_adapter.receive(&socket_adapter, pp_file);
if (res < 0) {
socket_adapter.close(&socket_adapter);
- if (socket_adapter.reinit(&socket_adapter) != 0) {
- socket_adapter.close(&socket_adapter);
- usleep(MCELOG_POLL_TIMEOUT);
+ while (socket_adapter.reinit(&socket_adapter) != 0) {
+ nanosleep(&CDTIME_T_TO_TIMESPEC(MS_TO_CDTIME_T(MCELOG_POLL_TIMEOUT)),
+ NULL);
}
continue;
}