python-diamond / Diamond

Diamond is a python daemon that collects system metrics and publishes them to Graphite (and others). It is capable of collecting cpu, memory, network, i/o, load and disk metrics. Additionally, it features an API for implementing custom collectors for gathering metrics from almost any source.
http://diamond.readthedocs.org/
MIT License
1.74k stars 601 forks source link

Allow aborting when the handlers process exit #628

Closed rksatyam closed 7 years ago

rksatyam commented 7 years ago

The main diamond process takes care of the exited collectors but doesn't really take care of the exited handlers. This caused a problem for us where we weren't getting the stats. If the whole process had exited, the full diamond process could have got restarted by the svc daemon. Hence, created an option to allow aborting when the handlers process exits and in that case it just exits.

Tested the option by manually killing the Handlers process and ensuring that the diamond process exits when the option is true and not otherwise.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.04%) to 24.766% when pulling 854cadc4a79ff17edd72834829999bac46a7d9a5 on rksatyam:master into a6ba91ce79ef02e86f5b57434c4dd05f93545d22 on python-diamond:master.

jaingaurav commented 7 years ago

Full disclosure: @rksatyam work together in our current company and discussed this change.

@shortdudey123: This change seems reasonable to me. I spoke to @rksatyam and he has done manual verification by killing the process to get this to trigger. I'm not sure it's easy to test given the current diamond testing framework.

If you're otherwise good with it, let's pull it in.

shortdudey123 commented 7 years ago

@jaingaurav cool, just wanted another set of eyes since this is core code :)