You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "MishimaPorte (via GitHub)" <gi...@apache.org> on 2024/07/29 14:24:18 UTC

[I] Readers leak timers when closed [pulsar-client-go]

MishimaPorte opened a new issue, #1262:
URL: https://github.com/apache/pulsar-client-go/issues/1262

   #### Expected behavior
   
   Readers should call `ticker.Stop()` on `timedAckGroupingTracker` when they are closed (e.g. when a reader is closed).
   
   #### Actual behavior
   
   The `ticker.Stop` method is never called on the `timedAckGroupingTracker` 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).
   
   ![the_bad](https://github.com/user-attachments/assets/436928dd-7393-4d45-9c53-71c680077ec8)
   
   #### System configuration
   **Pulsar version**: 2.10
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Readers leak timers when closed [pulsar-client-go]

Posted by "geniusjoe (via GitHub)" <gi...@apache.org>.
geniusjoe commented on issue #1262:
URL: https://github.com/apache/pulsar-client-go/issues/1262#issuecomment-2323752749

   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()
   	}
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Readers leak timers when closed [pulsar-client-go]

Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece closed issue #1262: Readers leak timers when closed
URL: https://github.com/apache/pulsar-client-go/issues/1262


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org