Skip to content

Commit 6d61830

Browse files
committed
on demand workers
1 parent a4758c2 commit 6d61830

File tree

3 files changed

+72
-215
lines changed

3 files changed

+72
-215
lines changed

hitless/config.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ type Config struct {
103103
// HandoffQueueSize is the size of the buffered channel used to queue handoff requests.
104104
// If the queue is full, new handoff requests will be rejected.
105105
//
106-
// Default: 10x max workers, but never more than pool size
106+
// Default: 10x max workers, but never more than pool size, min 2
107107
HandoffQueueSize int
108108

109109
// PostHandoffRelaxedDuration is how long to keep relaxed timeouts on the new connection
@@ -383,6 +383,10 @@ func (c *Config) ApplyDefaultsWithPoolSize(poolSize int) *Config {
383383
} else {
384384
result.HandoffQueueSize = c.HandoffQueueSize
385385
}
386+
// Ensure minimum queue size of 2
387+
if result.HandoffQueueSize < 2 {
388+
result.HandoffQueueSize = 2
389+
}
386390

387391
if c.PostHandoffRelaxedDuration <= 0 {
388392
result.PostHandoffRelaxedDuration = result.RelaxedTimeout * 2

0 commit comments

Comments
 (0)