Skip to content

Commit

Permalink
fix: Retry GET against 502, 503 responses (#129)
Browse files Browse the repository at this point in the history
* fix: Retry GET against 502, 503 responses

* fix: Appliy PR Review comment (style)
  • Loading branch information
kar0t authored Nov 10, 2024
1 parent bad4b34 commit 80f342d
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
unless [502, 503, 504].include?(response.status)
# deterministic error
exception! TrinoHttpError.new(response.status, "Trino API error at #{uri} returned #{response.status}: #{response.body}")
end
Expand Down

0 comments on commit 80f342d

Please sign in to comment.