Client Connections
Last updated
This page explains how a ToriiDB daemon client pools connections, applies deadlines, and retries dropped connections.
Client Connection Handling
| Behavior | Value |
|---|---|
| Idle pool | Up to 8 connections, reused only if idle for less than 5 s |
| Call deadline | ctx deadline, or 10 s when ctx has none; cancelling ctx closes the connection |
| Retry | A reused connection that fails with EOF, EPIPE, or ECONNRESET is discarded. The call then makes up to 3 fresh attempts with 5 ms and 10 ms backoff; an attempt is retried when the dial fails or the fresh connection drops with one of those errors, and the last error is returned |
| Non-retried errors | Remote error responses and decode failures return immediately |
| Server deadlines | 30 s read and 30 s write per frame; an idle connection is closed after 30 s |