From 7ca86a65e6c6f1ae024f5606bb14b054578c9549 Mon Sep 17 00:00:00 2001 From: Drew Raines Date: Tue, 9 Jun 2026 22:37:35 +0000 Subject: [PATCH] fix(iroh-dns): lower default TXT TTL from 30s to 5s The TTL gates how quickly a restarted connector becomes reachable; control-plane plumbing finishes in <1s but the gateway's resolver serves the stale answer until the TTL expires. Measured on datum-connect (headless tunnel CLI): Restart immediately after stop, TTL=30: ~30s to proxy responding Restart 35s after stop (TTL elapsed): ~1s Refs: datum-cloud/enhancements#756 --- internal/config/config.go | 8 +++++++- internal/config/config_test.go | 2 +- internal/config/zz_generated.defaults.go | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 200cae2a..7ad2e123 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -197,7 +197,13 @@ type IrohConnectorConfig struct { // TTLSeconds is the TTL written on each TXT record. // - // +default=30 + // Restarting a connector before the previous record's TTL expires + // leaves the gateway's resolver serving the stale answer, which + // gates how quickly a restart becomes reachable. 5s keeps that + // floor low while staying well within normal authoritative DNS + // query rates for the connector zone. + // + // +default=5 TTLSeconds int32 `json:"ttlSeconds,omitempty"` } diff --git a/internal/config/config_test.go b/internal/config/config_test.go index b8807ce9..ee932945 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -100,7 +100,7 @@ func TestSetObjectDefaults_IrohConnectorConfig(t *testing.T) { if got, want := iroh.RecordPrefix, "_iroh"; got != want { t.Errorf("RecordPrefix = %q, want %q", got, want) } - if got, want := iroh.TTLSeconds, int32(30); got != want { + if got, want := iroh.TTLSeconds, int32(5); got != want { t.Errorf("TTLSeconds = %d, want %d", got, want) } if iroh.DownstreamKubeconfigPath != "" { diff --git a/internal/config/zz_generated.defaults.go b/internal/config/zz_generated.defaults.go index d3dc318f..0be1aa07 100644 --- a/internal/config/zz_generated.defaults.go +++ b/internal/config/zz_generated.defaults.go @@ -234,7 +234,7 @@ func SetObjectDefaults_NetworkServicesOperator(in *NetworkServicesOperator) { in.Connector.Iroh.RecordPrefix = "_iroh" } if in.Connector.Iroh.TTLSeconds == 0 { - in.Connector.Iroh.TTLSeconds = 30 + in.Connector.Iroh.TTLSeconds = 5 } SetDefaults_DiscoveryConfig(&in.Discovery) if in.Redis.DialTimeout == nil {