Closed MishimaPorte closed 3 weeks ago
@MishimaPorte Do you mean we need some code snippet like below?
func (t *timedAckGroupingTracker) close() {
t.flushAndClean()
if t.exitCh != nil {
close(t.exitCh)
}
if t.ticker != nil {
t.ticker.Stop()
}
}
Expected behavior
Readers should call
ticker.Stop()
ontimedAckGroupingTracker
when they are closed (e.g. when a reader is closed).Actual behavior
The
ticker.Stop
method is never called on thetimedAckGroupingTracker
member ticker, and so it is leaked.Steps to reproduce
Create and close a substantial amount of Reader instances (using client.CreateReader()). After a substantial amount of Tickers is leaked, you will notice massive performance penalties due to go runtime's handling of all the leaked tickers and increasing amounts of Ticker objects allocated (the picture is from the standard go pprof tool, showing 90Mb of Ticker objects allocated).
System configuration
Pulsar version: 2.10