Program Streams Errors and Reconnects
Common status codes
| Code | Cause | Your action |
|---|---|---|
UNAUTHENTICATED | Missing or invalid API key | Replace the key |
PERMISSION_DENIED | Policy blocks the topic | Check account and policy scope |
NOT_FOUND | Topic name is stale | Refresh ListTopics |
INVALID_ARGUMENT | Topic or format is malformed | Fix the request |
RESOURCE_EXHAUSTED | Account limit reached | Close unused subscriptions |
UNAVAILABLE | Temporary transport failure | Reconnect with backoff |
INTERNAL | Server processing failed | Retry once, then record details |
Reconnect flow
- Store the last processed slot.
- Close the failed channel.
- Wait with exponential backoff and jitter.
- Refresh topics after catalog errors.
- Open a fresh TLS channel.
- Subscribe again.
- Deduplicate overlap in storage.
Program Streams do not accept a replay slot.
For gap-sensitive systems, pair the stream with Yellowstone or RPC reads.
Schema changes
Hash the proto_schema response.
When the hash changes:
- Pause deployment.
- Regenerate payload clients.
- Decode stored fixtures.
- Resume consumers after tests pass.
Backpressure
Do not run slow database work inside the gRPC data callback.
Place events in a bounded queue. Stop or restart the stream when the queue reaches its limit.