Skip to content

Fix Unicorn not cleaning up stale metrics file at startup

Stan Hu requested to merge sh-fix-unicorn-not-cleaning-up-metrics into master

The before_exec hook in Unicorn causes GitLab to clean up metrics files, but that hook does not run if Unicorn if starts up anew.

There's no before_master_fork hook or something similar, but https://github.com/defunkt/unicorn/blob/master/examples/unicorn.conf.rb#L66 shows an example of how to do the equivalent using a flag inside the config script.

We now use this run_once variable to clean up Prometheus metric files before running the master.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/62715

Edited by GitLab Release Tools Bot

Merge request reports