Open ItalyPaleAle opened 1 year ago
what's your ideas ?
@francisoliverlee I am not familiar with this library enough to suggest how it should be changed, but the general pattern is to initialize these things lazily.
That is: the object is only initialized (and the goroutine started) when it's first needed.
BUG REPORT
This is an issue we've discovered in Dapr because we offer support for RocketMQ.
Please describe the issue you observed:
What did you do (The steps to reproduce)? Import the rocketmq-client-go library, even if no client is initialized
What did you expect to see? Nothing should happen - the library should not initialize objects just because it's imported. All caches should be loaded lazily.
What did you see instead? This line causes
RequestResponseFutureMap
to be initialized as a global variable, which allocates arequestResponseFutureCache
and spawns a goroutinePlease tell us about your environment:
What is your OS? Linux/amd64
What is your client version? 2.1.2
What is your RocketMQ version? N/A
Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):