You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "ItalyPaleAle (via GitHub)" <gi...@apache.org> on 2023/06/06 18:06:48 UTC
[GitHub] [rocketmq-client-go] ItalyPaleAle opened a new issue, #1068: `RequestResponseFutureMap` is not loaded lazily and creates a goroutine just by importing this package
ItalyPaleAle opened a new issue, #1068:
URL: https://github.com/apache/rocketmq-client-go/issues/1068
**BUG REPORT**
This is an issue we've discovered in Dapr because we offer support for RocketMQ.
1. 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](https://github.com/apache/rocketmq-client-go/blob/2a8172bb9174d82173ca51488ddb253bdbc22cb5/internal/request_response_future.go#L33) causes `RequestResponseFutureMap` to be initialized as a global variable, which allocates a `requestResponseFutureCache` and spawns a goroutine
2. Please 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
3. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
--
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@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-client-go] ItalyPaleAle commented on issue #1068: `RequestResponseFutureMap` is not loaded lazily and creates a goroutine just by importing this package
Posted by "ItalyPaleAle (via GitHub)" <gi...@apache.org>.
ItalyPaleAle commented on issue #1068:
URL: https://github.com/apache/rocketmq-client-go/issues/1068#issuecomment-1598180559
@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.
--
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@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-client-go] francisoliverlee commented on issue #1068: `RequestResponseFutureMap` is not loaded lazily and creates a goroutine just by importing this package
Posted by "francisoliverlee (via GitHub)" <gi...@apache.org>.
francisoliverlee commented on issue #1068:
URL: https://github.com/apache/rocketmq-client-go/issues/1068#issuecomment-1598028534
what's your ideas ?
--
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@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org