Branch
Evidence
easebuzz/easebuzz/utils/payment.py#L541
easebuzz/easebuzz/utils/transaction.py#L379
easebuzz/easebuzz/utils/transaction_date.py#L299
easebuzz/easebuzz/utils/refund.py#L390
easebuzz/easebuzz/utils/payout.py#L345
All these paths call requests.post(...) without timeout and without retry/backoff strategy.
Problem
External gateway calls run without network time bounds. A slow/downstream gateway can block worker threads and degrade request throughput.
Risk/Impact
- Stuck web workers/background jobs under network stalls.
- Cascading latency spikes during gateway degradation.
- Poor operational recoverability (no retry/backoff policy).
Replication suggestion
- Simulate gateway endpoint slowness (iptables/tc proxy delay or blackhole).
- Trigger payment/transaction/refund/payout APIs.
- Observe requests hanging until OS/network defaults, with no controlled timeout.
Expected: bounded timeout and controlled retry policy.
Actual: unbounded waits.
Resolution suggestion
- Add explicit timeout tuple:
timeout=(connect_timeout, read_timeout) for every requests.post.
- Implement retry with capped exponential backoff for transient network failures (idempotent operations only).
- Normalize error handling to return typed failure payloads and structured logs.
Acceptance criteria
- Every outbound HTTP call to Easebuzz defines explicit timeout.
- Transient failures are retried per policy; permanent failures fail fast.
- Observability includes failure reason and latency metrics.
- Integration tests cover timeout behavior.
Branch
devEvidence
easebuzz/easebuzz/utils/payment.py#L541easebuzz/easebuzz/utils/transaction.py#L379easebuzz/easebuzz/utils/transaction_date.py#L299easebuzz/easebuzz/utils/refund.py#L390easebuzz/easebuzz/utils/payout.py#L345All these paths call
requests.post(...)withouttimeoutand without retry/backoff strategy.Problem
External gateway calls run without network time bounds. A slow/downstream gateway can block worker threads and degrade request throughput.
Risk/Impact
Replication suggestion
Expected: bounded timeout and controlled retry policy.
Actual: unbounded waits.
Resolution suggestion
timeout=(connect_timeout, read_timeout)for everyrequests.post.Acceptance criteria