ganglia/monitor-core — pull request #73 by satterly (2013-01-16 12:11:59+00:00)
Title: Stop gmetad segfaulting on empty cluster or grid tags

When run in non-scalable mode, gmetad segfaults if the downstream gmetad returns an empty GRID (which can happen if no gmonds for a data source are responding). The segfaults are caused by attempts to unlock a GRID and CLUSTER mutex that isn't set because gmetad's in non-scalable mode ignore GRID tags and so the mutex was never set in the first place.

To prevent unlocking mutexes that haven't been set it was necessary to change the switch statement that is used to write RRD summaries on all </GRID> and </CLUSTER> end tags. One unintended benefit of this patch is that a major cause of the RRD_update error messages "illegal attempt to update using time 1358335262 when last update time is 1358335262 (minimum one second step)" no longer occurs. (Note that there are still other reasons that this error might be generated such as multiple clusters with the same name or servers not being time synched).