From 3002bdcaa4ec22aa46b6c98eefda2f926dfff618 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 2 Mar 2026 10:31:26 +0200 Subject: handlers: use turbo EOF acknowledgement instead of sleep heuristic --- internal/server/handlers/readcommand_server.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'internal/server/handlers/readcommand_server.go') diff --git a/internal/server/handlers/readcommand_server.go b/internal/server/handlers/readcommand_server.go index 46f61a4..2c0a616 100644 --- a/internal/server/handlers/readcommand_server.go +++ b/internal/server/handlers/readcommand_server.go @@ -33,6 +33,8 @@ type readCommandServer interface { FlushTurboData() SignalTurboEOF() GetTurboChannel() chan []byte + TurboChannelLen() int + WaitForTurboEOFAck(timeout time.Duration) bool ReadGlobRetryInterval() time.Duration ReadRetryInterval() time.Duration AggregateLinesChannelBufferSize() int @@ -40,6 +42,7 @@ type readCommandServer interface { TurboEOFWaitDuration(fileCount int) time.Duration ShutdownTurboSerializeWait() time.Duration ShutdownIdleRecheckWait() time.Duration + TurboEOFAckTimeout() time.Duration } var _ readCommandServer = (*ServerHandler)(nil) @@ -126,6 +129,10 @@ func (h *ServerHandler) FlushTurboData() { h.flushTurboData() } +func (h *ServerHandler) TurboEOFAckTimeout() time.Duration { + return durationFromMilliseconds(h.serverCfg.TurboEOFAckTimeoutMs, 2*time.Second) +} + func durationFromMilliseconds(value int, fallback time.Duration) time.Duration { if value <= 0 { return fallback -- cgit v1.2.3