Allow configuring open/read timeouts for API requests
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Ruby
- Estrellas
- 1.1k
- Forks
- 485
- Merge medio
- 4 h 38 min
- PR fusionados (30 d)
- 1
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Shopify/shopify-api-ruby
-
devtools-gardener
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Shopify/shopify-api-ruby#1456 · 3 reacciones ·
-
automated
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Shopify/shopify-api-ruby#1465 ·
-
oj dependency breaks support for JRubyPosiblemente ocupada @najibna la tomó hace 15 días. Abiertodevtools-gardener
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
Shopify/shopify-api-ruby#1461 · 1 comentario ·
-
automated
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Shopify/shopify-api-ruby#1460 ·
-
devtools-gardener
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Shopify/shopify-api-ruby#1455 ·
Todos los issues de Shopify/shopify-api-ruby
Issues similares
-
Použiť Redis pre ActionCableAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
slovensko-digital/autogram-portal#392 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
revoir les metions de la DGEAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
betagouv/conseillers-entreprises#4720 ·
Los mantenedores suelen responder en 3 días
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
zerocracy/judges-action#2692 · 1 comentario ·
Los mantenedores suelen responder en 6 días
-
agent:triaged bug bughunt pm:bundler priority:p1
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
SocketDev/socket-patch#896 · 1 comentario ·
Los mantenedores suelen responder en 1 día