Skip to content

Commit

Permalink
fix: Retry GET against 502, 503 responses
Browse files Browse the repository at this point in the history
  • Loading branch information
kar0t committed Nov 9, 2024
1 parent bad4b34 commit aee2e2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/trino/client/statement_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ def faraday_get_with_retry(uri, &block)
return response
end

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

0 comments on commit aee2e2c

Please sign in to comment.