Allow configuring open/read timeouts for API requests
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Ruby
- Sterne
- 1.1k
- Forks
- 487
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 3
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus Shopify/shopify-api-ruby
-
devtools-gardener
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Shopify/shopify-api-ruby#1456 · 3 Reaktionen ·
-
2026-10 supportOffendevtools-gardener
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
Shopify/shopify-api-ruby#1476 ·
-
automated
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
Shopify/shopify-api-ruby#1465 ·
-
oj dependency breaks support for JRubyEvtl. vergeben @najibna hat das vor 38 Tagen übernommen. Offendevtools-gardener
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 67/100
Shopify/shopify-api-ruby#1461 · 1 Kommentar ·
-
automated
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
Shopify/shopify-api-ruby#1460 ·
Alle Issues in Shopify/shopify-api-ruby
Ähnliche Issues
-
documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
alphagov/tech-docs-gem#580 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Onboarding form: instructor radio never pre-selected "Yes" (permission vs permissions typo)Evtl. vergeben @ThakuraAnki hat das heute übernommen. Offenbug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
WikiEducationFoundation/WikiEduDashboard#7235 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement priority: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
davidteren/mutineer#361 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
zerocracy/judges-action#3021 ·
Maintainer antworten meist innerhalb von 2 Tagen