From: Pavel Rochnyack Date: Wed, 19 Dec 2018 12:57:04 +0000 (+0700) Subject: processes: Fix 'delay_rate' race condition X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c5e7240d111bacb9c398c44a5f9825782970e59d;p=collectd.git processes: Fix 'delay_rate' race condition When ts_delay_by_tgid() failed (for example, when observable process terminates), `ps->delay` fields are not updated and remain set to zero. This interpreted as counter overflow and produces spike. Issue: #3026 --- diff --git a/src/processes.c b/src/processes.c index ce4cc652..171dde95 100644 --- a/src/processes.c +++ b/src/processes.c @@ -587,7 +587,8 @@ static void ps_list_add(const char *name, const char *cmdline, entry->cpu_system_counter); #if HAVE_LIBTASKSTATS - ps_update_delay(ps, pse, entry); + if (entry->has_delay) + ps_update_delay(ps, pse, entry); #endif } }