Skip to content

Commit bf5efb8

Browse files
Add 502 handling to Webonary retry (user saw this testing LT-22342)
1 parent d6db6ca commit bf5efb8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Src/xWorks/WebonaryClient.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ private string PostToWebonaryApi(string address, string postBody, string extraAr
113113

114114
var statusCode = ((HttpWebResponse)ex.Response).StatusCode;
115115

116-
// Only retry on 504 Gateway Timeout or 503 Service Unavailable
116+
// Only retry on 504 Gateway Timeout or 503 Service Unavailable or 502 Bad Gateway (common for server overload)
117117
if ((statusCode == HttpStatusCode.GatewayTimeout ||
118-
statusCode == HttpStatusCode.ServiceUnavailable) && attempt < maxRetries)
118+
statusCode == HttpStatusCode.ServiceUnavailable ||
119+
statusCode == HttpStatusCode.BadGateway) && attempt < maxRetries)
119120
{
120121
Thread.Sleep(retryDelay);
121122
retryDelay *= 2; // Exponential backoff

0 commit comments

Comments
 (0)