Increase git-remote-entire Timeout Default

when cloning or fetching an Entire repo via git-remote-entire, every so often i hit a timeout on the initial "which nodes serve this repo" request. That kinda sucks. I think we should loosen the default timeout a bit, maybe, say, 10s?
All green. Here's the bottom line.
What I changed
The flaky timeout was the 2s TCP connect budget (DefaultDialTimeout), which is shared between the cold "which nodes serve this repo" probe and dead-node failover. Per your choice, I split them rather than slowing failover down.
internal/entireclient/httpclient/transport.go— addedDefaultDiscoveryDialTimeout = 10s, aDiscoveryDialTimeout()(honorsENTIRE_CONNECT_TIMEOUT_SECONDS, never returns less than 10s), andNewDiscoveryTransport().DefaultDialTimeoutstays 2s.internal/remotehelper/transport/proxy.go— the proxy now builds a second, wrapped transport (discoveryTransport) with the 10s budget.noRedirectClient()(the cold info/refs entry-domain probe) uses it; everything else — warm failover and the bulk pack RPC — keeps the 2s transport.
Behavior
- Initial cold discovery connect: 10s to absorb cold DNS + TLS to a distant entry LB.
- Dead-replica failover: unchanged at 2s — still skips dead nodes fast.
ENTIRE_CONNECT_TIMEOUT_SECONDSstill works; discovery is floored at 10s, so raising it above 10 lifts both.
Tests
- New
TestDiscoveryDialTimeout(floor + override semantics) andTestNoRedirectClientPrefersDiscoveryTransport. - Updated
proxyWithClientso injected test clients (incl. TLS-trustingentry.Client()) still govern the cold path. mise run lintclean; full unit suite passes (6580 tests).
Not committed — yours to push. One judgment call worth flagging: I scoped this to the replica discovery probe (the X-Entire-Replicas info/refs path), matching your wording. The cluster /.well-known discovery in git-remote-entire's auth path is also a cold connect on a 2s dial, but it's cached 24h and wasn't what you described — say the word if you want it on the 10s budget too.
never returns less than 10s
i think if a user sets ENTIRE_CONNECT_TIMEOUT_SECONDS (use os.LookupEnv to check) we should use that timeout value for all timeouts, not just one or the other, or apply a minimum.
let's also turn the 2s default into 4s default. i have had trouble pushing when on satellite internet (no nodes respond <2s).
All green. Done.
Summary of this round
1. Env override now applies to all connect timeouts (os.LookupEnv) — internal/entireclient/httpclient/transport.go
- New
envConnectTimeout()helper usesos.LookupEnv. WhenENTIRE_CONNECT_TIMEOUT_SECONDSis set to a positive int, bothDialTimeout()andDiscoveryDialTimeout()return that exact value — no flooring. Unset/blank/invalid falls back to each function's own default.
2. Default dial timeout 2s → 4s — for your satellite-internet push problem.
DefaultDialTimeout = 4 * time.Second.DefaultDiscoveryDialTimeoutstays 10s.
3. /.well-known cluster discovery now uses the patient budget — cmd/git-remote-entire/main.go
- The auth
httpClientswitched fromNewTransport(4s) toNewDiscoveryTransport(10s). It only talks to single control-plane hosts (cluster entry for well-known, core for token exchange) with no failover, so the longer budget fits the whole client — and the login provider, which borrowshttpClient.Transport, inherits it too.
Net behavior (no env override)
- Replica failover dial: 4s (was 2s).
- Cold replica discovery +
/.well-known+ token exchange: 10s. - With
ENTIRE_CONNECT_TIMEOUT_SECONDS=N: everything dials at N.
Tests updated (TestDiscoveryDialTimeout now asserts override-wins, incl. below-default); lint clean, full unit suite passes (6581). Not committed.
Committed on a new branch off main.
- Branch:
loosen-connect-timeouts(offorigin/main) - Commit:
fcc4748d7— 5 files, +138/−30 - Not pushed — yours to push when ready.