Skip to content

fix(backend): Stellar RPC calls have no socket-level timeout causing event loop starvation #473

@Akpolo

Description

@Akpolo

💬 Want to contribute? Join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0

Problem

Backend Stellar RPC calls in sorobanService.ts use the SDK's default 30-second transaction timeout but do not configure socket-level connection timeouts. If the RPC node is slow or hangs after accepting the connection, the request never times out and the caller waits indefinitely. This can exhaust the Node.js event loop and cause all subsequent requests to queue up.

Expected Behavior

All outbound RPC calls should have an explicit connection timeout (e.g. 10 seconds) and a total request timeout (e.g. 15 seconds) independent of the Stellar transaction timeout.

Suggested Fix

Configure the Stellar SDK's fetch option or wrap calls with Promise.race([rpcCall, timeout(10_000)]) to enforce a hard cap.

Location

backend/src/services/sorobanService.ts

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions