Fixes #39229 - Add foreman_request_timeout setting to control Net::HTTP read timeout#936
Fixes #39229 - Add foreman_request_timeout setting to control Net::HTTP read timeout#936pablomh wants to merge 1 commit intotheforeman:developfrom
Conversation
bc8b3c4 to
e774886
Compare
CI failure: rake 13.4.2 regression (not related to this PR)All test jobs fail with Root cause: This affects all new PRs on smart-proxy, not just this one. PR #935 passed because its bundle cache still had rake 13.3.1. Diff in # 13.3.1 — option_list never adds -v
def option_list
(ENV["TESTOPTS"] || ENV["TESTOPT"] || ENV["TEST_OPTS"] || ENV["TEST_OPT"] || @options || "")
end
# 13.4.2 — now adds -v when verbose is true
def option_list(verbose: @verbose)
opts = ENV["TESTOPTS"] || ENV["TESTOPT"] || ENV["TEST_OPTS"] || ENV["TEST_OPT"] || @options || ""
if verbose && !opts.split.include?("-v")
opts = opts.empty? ? "-v" : "#{opts} -v"
end
opts
endFix options:
|
ekohl
left a comment
There was a problem hiding this comment.
Makes sense, but 1 minor comment inline.
…TP read timeout ForemanRequest uses a bare Net::HTTP instance whose read_timeout defaults to Ruby's hardcoded 60s. Under high-concurrency registration load this causes 500 errors when Foreman takes longer than 60s to process POST /register. Introduces :foreman_request_timeout (documented in settings.yml.example) and applies it to http.read_timeout in ForemanRequest#http_init when configured. The respond_to? guard preserves backward compatibility when the setting is absent. subscription-manager's default server_timeout is 180s, so values above that are recommended to avoid cutting connections the client is still waiting on. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
e774886 to
8071686
Compare
Problem
ForemanRequestuses a bareNet::HTTPinstance whoseread_timeoutdefaults to Ruby's hardcoded 60s. Under high-concurrency registration load this causes 500 errors when Foreman takes longer than 60s to processPOST /register.Fix
Introduces
:foreman_request_timeoutand documents it insettings.yml.example, then applies it tohttp.read_timeoutinForemanRequest#http_initwhen configured and greater than zero. Therespond_to?guard preserves backward compatibility when the setting is absent.subscription-manager's defaultserver_timeoutis 180s, so values above that are recommended to avoid cutting connections the client is still waiting on.Fixes https://projects.theforeman.org/issues/39229