]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: promex: Skip resolvers metrics when there is no resolver section
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 12 Jun 2024 06:42:56 +0000 (08:42 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 12 Jun 2024 06:55:52 +0000 (08:55 +0200)
commit91fe085943cea52d0c3d04e81f8ecb6a51668b09
tree506af3e495a0877c7e9b09e54a6af9c47278a68e
parentc157894ba97a40f40f777344041841e423f99c2c
BUG/MINOR: promex: Skip resolvers metrics when there is no resolver section

By default, there is always at least on resolver section, the default one,
based on "/etc/resolv.conf" content. However, it is possible to have no
resolver at all if the file is empty or if any error occurred. Errors are
silently ignored at this stage.

In that case, there was a bug in the Prometheus exporter leading to a crash
because the resolver section list is empty. An invalid resolver entity was
used. To fix the issue we must only take care to not dump resolvers metrics
when there is no resolver.

Thanks to Aurelien to have spotted the offending commit.

This patch should fix the issue #2604. It must be backported to 3.0.
src/resolvers.c