BUG/MEDIUM: wdt: always ignore the first watchdog wakeup
authorWilly Tarreau <w@1wt.eu>
Tue, 20 May 2025 13:52:44 +0000 (15:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 May 2025 14:48:12 +0000 (16:48 +0200)
commit8184a304c0f9903955e07481964888ada5f1d6a1
tree174547c67e1727da381a9e2f5738e1c74e19aa6d
parent76636502b94941061a887566d268ffa6f01e61ca
BUG/MEDIUM: wdt: always ignore the first watchdog wakeup

With commit a06c215f08 ("MEDIUM: wdt: always make the faulty thread
report its own warnings"), when the TH_FL_STUCK flag was flipped on,
we'd then go to the panic code instead of giving a second chance like
before the commit. This can trigger rare cases that only happen with
moderate loads like was addressed by commit 24ce001771 ("BUG/MEDIUM:
wdt: fix the stuck detection for warnings"). This is in fact due to
the loss of the common "goto update_and_leave" that used to serve
both the warning code and the flag setting for probation, and it's
apparently what hit Christian in issue #2980.

Let's make sure we exit naturally when turning the bit on for the
first time. Let's also update the confusing comment at the end of
the check that was left over by latest change.

Since the first commit was backported to 3.1, this commit should be
backported there as well.

(cherry picked from commit 0a8bfb5b900f017c17bf6460669a18cf693b5927)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/wdt.c