summaryrefslogtreecommitdiff
path: root/internal/server/handlers/readcommand_server.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-02 10:31:26 +0200
committerPaul Buetow <paul@buetow.org>2026-03-02 10:31:26 +0200
commit3002bdcaa4ec22aa46b6c98eefda2f926dfff618 (patch)
tree43cc06e2bd690b41b33a3b56735823affed541bb /internal/server/handlers/readcommand_server.go
parent29e50d7b6ebb9e6c59d079ef5b7551b1acd950fb (diff)
handlers: use turbo EOF acknowledgement instead of sleep heuristic
Diffstat (limited to 'internal/server/handlers/readcommand_server.go')
-rw-r--r--internal/server/handlers/readcommand_server.go7
1 files changed, 7 insertions, 0 deletions
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