Feature: Connection timeouts, retries, and keepalive #180
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Corresponding rsync flags/behavior:
--timeout=SECONDS— I/O timeout--contimeout=SECONDS— connection timeout--retries=N— number of attempted retries for a failed connectionCurrent FastSync behavior:
src/shared/transport_tcp.ccreates blocking sockets with no timeout.receive_n_data()insrc/shared/protocol.ccan block forever on a stalled connection. There are no TCP keepalive options and no retry logic.Proposed changes:
--timeout=<sec>,--contimeout=<sec>,--retries=<n>int io_timeout_sec,int connect_timeout_sec,int connect_retriesSO_RCVTIMEO/SO_SNDTIMEOorpoll()with timeout insend_n_data/receive_n_dataSO_KEEPALIVEand optional TCP_USER_TIMEOUT on Linux--retrieswith exponential backoffexecvp(already partially handled via exec_pipe) and retryPriority: high
Rationale: Without timeouts, a single hung connection can stall a sync job indefinitely. Retries are essential for automation over unreliable networks.
Acceptance criteria:
--timeout=30causes a stalled receive to error out after 30 seconds--contimeout=10fails fast when the server is unreachable--retries=3attempts the connection three times before failing