Allow configuring open/read timeouts for API requests
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
Start with ShopifyAPI::Context.setup and ShopifyAPI::Clients::HttpClient#request, then inspect the existing retry behavior. Add the two optional timeout settings and verify they are passed to HTTParty on every request while unset settings preserve current behavior and timeout exceptions are not retried.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Overview
ShopifyAPI::Clients::HttpClient#request calls HTTParty without a timeout, so every Admin API request uses Net::HTTP's default 60-second read timeout. When Shopify is slow to send the first byte, the calling thread waits for as long as that takes. On a web server, that thread is a request worker.
In production we saw a stalled Admin GraphQL read hold a Puma thread for 27.5s, while our p99.9 for the same calls is about 2s. The client has no supported way to set a shorter limit. The only workaround is to monkey-patch HTTParty.
Proposal
Add optional open_timeout and read_timeout (seconds) to ShopifyAPI::Context.setup, and pass them to HTTParty on every request:
ShopifyAPI::Context.setup(
# other params...
open_timeout: 5,
read_timeout: 10,
)
When they aren't set, behaviour stays exactly as it is today. A timeout raises Net::OpenTimeout or Net::ReadTimeout out of the client; the existing retry loop only retries 429/500 responses, so a timeout isn't retried.
Related
- #1456 asks for arbitrary HTTParty options to be passed through.
- #1376 implements a general
httparty_paramshash (timeouts, proxy, debug output). It has been open since April 2025.
This proposal is deliberately narrower: just the two timeouts, as typed Context settings. That keeps the change small and easy to review, and doesn't commit the gem to exposing all of HTTParty's options. If maintainers prefer the general approach in #1376, that covers this too.
- Linguagem predominante
- Ruby
- Estrelas
- 1.1k
- Forks
- 487
- Merge médio
- 1d 8h
- PRs com merge (30d)
- 3
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de Shopify/shopify-api-ruby
-
devtools-gardener
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Shopify/shopify-api-ruby#1456 · 3 reações ·
-
2026-10 supportAbertadevtools-gardener
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
Shopify/shopify-api-ruby#1476 ·
-
automated
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
Shopify/shopify-api-ruby#1465 ·
-
oj dependency breaks support for JRubyTalvez já em andamento @najibna assumiu há 42 dias. Abertadevtools-gardener
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 67/100
Shopify/shopify-api-ruby#1461 · 1 comentário ·
-
automated
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
Shopify/shopify-api-ruby#1460 ·
Todas as issues de Shopify/shopify-api-ruby
Issues semelhantes
-
intercepted.rb crashes on an optional positional argument when the method also takes keywordsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
yegor256/intercepted#128 ·
-
documentation good first issue
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
ysb3996-blip/oops#51 ·
Mantenedores costumam responder em até 1 dia
-
good first issue
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
Remove leftover Cloud66 custom_web process from ProcfileTalvez já em andamento @ShahadatTest assumiu hoje. AbertaDifficulty: Easy Good First Issue
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
rubyforgood/casa#7330 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area:core-lib P2 size:S
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia