fix(stripe): add request timeout to raw reqwest calls into Stripe API #104
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
psa-systems/bunyip!104
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/stripe-client-timeout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes BUNYIP-82.
Three
reqwest::Client::new()call sites incrates/bunyip-domain/src/services/stripe.rs(webhook endpoint list / create / delete) had no timeout configured.Client::new()returns a client with no request, connect, or read timeout, so a hung Stripe upstream (network blip, regional outage, blackhole) blocks the awaiting actix worker indefinitely. A sufficiently long-lived stall can lock workers against a finite pool.Replace the three sites with a single shared helper
stripe_http_client()that builds areqwest::Clientwith.timeout(Duration::from_secs(STRIPE_API_TIMEOUT_SECS)). Ten seconds is the ceiling for these webhook-endpoint CRUD calls; checkout / cancel flows run through the async-stripe client and inherit its own timeouts, so they are not touched. Adding the helper rather than inlining the builder keeps one source of truth for the value.No behaviour change on the happy path. On a hung upstream, the call now returns
reqwest::Error::is_timeout() == truewithin ten seconds instead of blocking the worker.Pre-existing
test_config_defaultsflake on main is unrelated (parallel env-var race inconfig.rs:778); fmt + clippy + build clean.#BUNYIP-82