munin-monitoring/munin — pull request #186 by steveschnepp (2014-02-25 13:30:13+00:00)
Title: master/Update: atomic write datafile with tmp+ren

As kjetilho noticed on IRC :

The problem is that if "munin-limits --force" is run outside munin-cron, it
typically might run while munin-update is writing a new datafile.

As writing a new datafile takes many seconds, munin-limits only sends OK
for a subset of the nodes

So now we just use a temporary file, that is updated via a atomic rename().
Note that we should also be able to remove the lock, but let's remain on the
safe side in the stable-2.0 branch.