From e03ebe77c257e44645c64c8cd71e5e7c115991ef Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Mon, 20 Feb 2023 14:46:41 -0500 Subject: [PATCH 1/1] 20137: Fix incorrect keyword in RailsAPI config reload loop The reason rails_restart_test.go has been racey is because the code under test is actually buggy. If the configuration reload loop ever encounters a condition where it wants to restart (probably `hash == hash_lastload`), it tries to call a nonexistent method `continue`, the thread crashes, the configuration never gets reloaded, and the test fails. Use the intended Ruby keyword `next` instead. Closes #20137. Arvados-DCO-1.1-Signed-off-by: Brett Smith --- services/api/config/initializers/reload_config.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/api/config/initializers/reload_config.rb b/services/api/config/initializers/reload_config.rb index 1582855bfb..bdc815099d 100644 --- a/services/api/config/initializers/reload_config.rb +++ b/services/api/config/initializers/reload_config.rb @@ -35,13 +35,13 @@ else rescue => e Rails.logger.info("reload_config: config file updated but could not be loaded: #{e}") t_lastload = t - continue + next end if hash == hash_lastload # If we reloaded a new or updated file, but the content is # identical, keep polling instead of restarting. t_lastload = t - continue + next end restartfile = Rails.root.join('tmp', 'restart.txt') -- 2.30.2