Skip to content

Add retry to POST /v1/statement#157

Merged
yuokada merged 1 commit into
treasure-data:masterfrom
murakami-ta:retry-post-request
Jun 8, 2026
Merged

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

Conversation

@murakami-ta

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

Copy link
Copy Markdown
Contributor

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
@yuokada yuokada self-assigned this Jun 8, 2026
@yuokada yuokada self-requested a review June 8, 2026 02:20
@yuokada yuokada merged commit 64a5c66 into treasure-data:master Jun 8, 2026
9 checks passed
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.

2 participants