Temporal

Batcher idle goroutine exit due to IdleTime configuration

info
performanceUpdated Mar 3, 2026

The Batcher's internal goroutine will exit after IdleTime to avoid wasting resources on idle streams. This is expected behavior but requires the goroutine to restart when new items arrive, which adds latency to the first item after idle periods.

Technologies:
How to detect:

IdleTime configuration in BatcherOptions causes internal goroutine to exit during periods of inactivity, adding startup latency when processing resumes

Recommended action:

1. Review BatcherOptions.IdleTime configuration to understand when goroutines will exit. 2. Monitor for latency spikes on first items after idle periods. 3. If frequent idle periods cause unacceptable latency, consider increasing IdleTime to keep goroutines alive longer. 4. Balance resource usage (memory for idle goroutines) against first-item latency requirements. 5. Ensure monitoring captures cold-start latency patterns after idle periods. 6. Document expected latency patterns for stakeholders using batched operations.