Skip to content

[Stability] Outbound Easebuzz HTTP calls have no timeout/retry controls #26

Description

@chromonav

Branch

  • dev

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

  1. Simulate gateway endpoint slowness (iptables/tc proxy delay or blackhole).
  2. Trigger payment/transaction/refund/payout APIs.
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions