anapsix / zabbix-haproxy

HAProxy Zabbix Discovery and Template
170 stars 77 forks source link

fix race condition leading to spurious 'server DOWN' events #23

Closed klaasjan closed 8 years ago

klaasjan commented 8 years ago

Tried out this integration tool on our production servers and was promptly greeted with 'server down' events. It seems Zabbix takes a bit of time before finishing writing the stats file and in the meantime there is no data for the stats script. The Zabbix template assumes no data is the same as server down...

noamik commented 8 years ago

Really minor nitpick: "mv" isn't guaranteed to be an atomic operation.

However this fix is better than the previous code, so I'd recommend merging it.

Edit: Stupid me, I forgot about the serialization of access you introduced with your move operation.

anapsix commented 8 years ago

Thanks @klaasjan