From 1bca57fa2addc3225056ac5182736358e32cfdce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Wed, 6 May 2026 18:50:53 -0300 Subject: [PATCH] fix: retry on HTTP 503 from OpenBMC REST API instead of failing OpenBMC BMCs intermittently return 503 Service Unavailable when the REST service is busy or recovering. xCAT reported the error immediately, requiring the user to manually retry. A second attempt usually succeeds. Retry the same request up to 3 times with a 3-second wait on 503. If all retries fail, report the error as before. The existing 504 handling for bmcreboot is preserved. Ref: #4264 --- xCAT-server/lib/xcat/plugins/openbmc.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 6183cf29b..346e67f76 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -2991,6 +2991,12 @@ sub deal_with_response { } if ($response->status_line eq $::RESPONSE_SERVICE_UNAVAILABLE) { + $node_info{$node}{_503_retries} = ($node_info{$node}{_503_retries} || 0) + 1; + if ($node_info{$node}{_503_retries} <= 3) { + $node_info{$node}{cur_status} =~ s/_RESPONSE$/_REQUEST/; + $node_wait{$node} = time() + 3; + return; + } $error = $::RESPONSE_SERVICE_UNAVAILABLE; } elsif ($response->status_line eq $::RESPONSE_METHOD_NOT_ALLOWED) { if ($node_info{$node}{cur_status} eq "REVENTLOG_RESOLVED_RESPONSE") {