-
- Downloads
Always shutdown webrick even if thread is not alive
This should properly shutdown webrick so that we don't need to forcefully kill the thread to shutdown webrick in the tests. Without properly shutting down webrick, we leak threads and other resources to each test cases, eventually causing everything to slow down and timing out the CI jobs. This is discovered in https://gitlab.com/gitlab-org/gitlab/-/issues/462928#note_1916591506 A quick fix was proposed in the above thread and merged in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/153887 This should properly shutdown webrick instead. * It should be safe to shutdown webrick regardless * In a test, we use a thread to wrap around `WEBrick::HTTPServer`, turning the blocking server into a non-blocking server. This means the daemon thread will stop immediately because everything is wrapped inside another thread. If we only shutdown webrick when the thread is alive, we're not shutting it down in this test case either, leaking resources. This preserves similar performance comparing to killing the thread. This partially reverts https://gitlab.com/gitlab-org/gitlab/-/commit/f5b1317af8aad2d8b7d098c0e4dada25ccfd924b
Please register or sign in to comment