Skip to content

Add retry to POST /v1/statement#157

Open
murakami-ta wants to merge 1 commit into
treasure-data:masterfrom
murakami-ta:retry-post-request
Open

Add retry to POST /v1/statement#157
murakami-ta wants to merge 1 commit into
treasure-data:masterfrom
murakami-ta:retry-post-request

Conversation

@murakami-ta
Copy link
Copy Markdown
Contributor

@murakami-ta murakami-ta commented Jun 5, 2026

Purpose

In our environment, POST /v1/statement occasionally fails with HTTP errors, so i want the trino-client-ruby gem to retry.
GET requests already retry Faraday errors inside the gem via faraday_get_with_retry, so i want POST to be retried inside the gem in the same way.

Overview

  • Extract the retry logic from faraday_get_with_retry into a shared with_retry_loop helper used by both GET and POST
  • Route post_query_request! through with_retry_loop to retry on Faraday::TimeoutError, Faraday::ConnectionFailed, and 502/503/504
  • Add specs for POST retry

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary

@murakami-ta murakami-ta requested a review from a team as a code owner June 5, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant