Skip to content

Commit aee2e2c

Browse files
committed
fix: Retry GET against 502, 503 responses
1 parent bad4b34 commit aee2e2c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/trino/client/statement_client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ def faraday_get_with_retry(uri, &block)
208208
return response
209209
end
210210

211-
if response.status != 503 # retry only if 503 Service Unavailable
211+
# retry if 502, 503, 504 according to the trino protocol
212+
if response.status == 502 || response.status == 503 || response.status == 504
212213
# deterministic error
213214
exception! TrinoHttpError.new(response.status, "Trino API error at #{uri} returned #{response.status}: #{response.body}")
214215
end

0 commit comments

Comments
 (0)