Skip to content
代码片段 群组 项目
未验证 提交 593bcda3 编辑于 作者: Stan Hu's avatar Stan Hu
浏览文件

Fix metrics server not shutting down when Puma is stopped

Previously if a separate metrics server were configured and
Puma were stopped, the metrics server would continue to run. When
Puma is started again, it attempts to spawn a new metrics server,
but this fails repeatedly because the port has already been taken.

To fix this, add an `at_exit` handler that will shutdown the process
supervisor if Puma exists. This won't help the case if Puma is
abruptly killed, however.

Relates to https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8109

Changelog: fixed
上级 ab20cbf1
No related branches found
No related tags found
无相关合并请求
......@@ -17,6 +17,12 @@ def start_for_puma
end
supervisor = PumaProcessSupervisor.instance
at_exit do
Gitlab::AppLogger.info("Puma process #{Process.pid} is exiting, shutting down metrics server...")
supervisor.shutdown
end
supervisor.supervise(start_server.call) do
Gitlab::AppLogger.info('Puma metrics server terminated, restarting...')
start_server.call
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册