Skip to content

Fix daemon memory killer busy loop risk

Qingyu Zhao requested to merge fix-daemon-memory-killer-busy-loop-risk into master

What does this MR do?

For issue #33009 (closed)

In the case when restart_sidekiq unless rss_within_range? throw StandardError, it will log the error and immediately continue do next loop iteration, without sleep(CHECK_INTERVAL_SECONDS). If this happens, it may bloat log file too much, and also the deamon thread is busy, until the StandardError gone.

Suggested fix is to always sleep(CHECK_INTERVAL_SECONDS) in the main loop body. Just re-order it as:

        while enabled?
          begin
            sleep(CHECK_INTERVAL_SECONDS)
            restart_sidekiq unless rss_within_range?
          rescue => e
... ...

Merge request reports