]> git.ipfire.org Git - thirdparty/chrony.git/commit
util: warn if UTI_OpenFile() is stuck in a loop
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 2 Jul 2025 13:34:03 +0000 (15:34 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 2 Jul 2025 14:02:41 +0000 (16:02 +0200)
commit1d9e080749d1c705263fb88438b889213689dccc
tree4df4b28ddbc8606668d8f493c8076b966fca3f23
parentd30913e78c7798ec2689a0b56cb3b5fd58631eec
util: warn if UTI_OpenFile() is stuck in a loop

When UTI_OpenFile() is removing an existing file to be replaced by a new
file, it could potentially get stuck in an infinite loop if something
was able to consistently win the race and create a new file before
chronyd.

Log a warning message after 100 failed attempts and repeat on each 10x
increase to make it more obvious to the admin, if it ever happens.

Reported-by: Eric Sesterhenn <eric.sesterhenn@x41-dsec.de>
util.c