honeybadger-io/honeybadger-ruby — pull request #59 by nirvdrum (2013-12-23 16:51:11+00:00)
Title: Allow the metrics worker thread to shut down so it won't remain live in hot deploy scenarios.

Fixes #58: Memory leak on JRuby.

With this, the thread should stick around for at most 60s after the shut down. Ideally it'd be a tighter interval than that, but I didn't want to adjust the `@delay` value because I wasn't sure if that would mess with your metrics stuff. An alternative may be to sleep tighter, but still only process metrics every 60s or so. I did this recently with rack-mini-profiler (https://github.com/nirvdrum/rack-mini-profiler/commit/91f1d9a98b6db12f6697b690d0ebd2c8e354890f).