Type: Problem report
Affects Version/s: 4.0.29, 5.0.12, 5.4.1, 6.0.0alpha1
Alpine 3.13/fping 5.0
Sprint:Sprint 77 (Jun 2021), Sprint 78 (Jul 2021)
I found icmpping items become unsupported state when zabbix-server is interrupted by any signal, such as SIGUSR1 (runtime control) or others.
I tested on Zabbix-4.0.29 on CentOS 7, but it can occur on other versions and platforms.
Here is zabbix_server.log messages.
It looks fping unexpectedly exited and zabbix-server could not get fping results.
I investigated the cause and figured out that fgets() returns NULL and set errno=EINTR if it is interrupted by a signal. But zabbix-server does not check errno and break fgets() loop.
So we maybe need to retry to call fgets() in the case. I made a patch to fix the problem. Would you mind checking it?
Steps to reproduce:
- install zabbix-server
- add hosts and configure icmpping items
- keep executing runtime control many times (e.g., zabbix_server -R log_level_increase)
- icmpping items become unsupported
zabbix-server can not get fping result and icmpping items become unsupported.
icmpping does not become unsupported.
P.S., similar problems might occur elsewhere using fgets(), but I have not checked.