RockteMQ-AI commented on issue #1316: URL: https://github.com/apache/rocketmq-clients/issues/1316#issuecomment-5370355211
Hi @leeo-zyf, thanks for reporting this! I've analyzed this issue against the codebase and can confirm this appears to be a **real bug**. **Root Cause:** ** In `golang/client.go` at line 604–611, `startUp()` added a blocking wait loop (`for !cli.inited.Load()`) that waits for `cli.inited` to become `true`. This flag is only set in `onSettingsCommand()` (line 738), which is only called when a Telemetry stream receives a Settings message from a broker. A Telemetry stream is only opened inside `getMessageQueues()` (line 367–377), which is only called during startup if `initTopics` is non-empty (line 552–557). When `WithTopics()` is not used, `initTopics` is empty, no Telemetry stream is ever created, `inited` is never set to `true`, and the loop spins forever. **Affected Files:** ** `golang/client.go` **Analysis:** ** The dependency chain is: `inited=true` ← `onSettingsCommand()` ← Telemetry stream ← `getMessageQueues()` ← non-empty `initTopics`. When `WithTopics()` is omitted (which is valid and common), the chain is never triggered, causing an infinite deadlock in `Producer.Start()`. This regression was introduced in v5.1.4 by adding the blocking wait without handling the empty-topics case. I'll prepare a fix spec and work on a PR. The community is welcome to provide feedback on the approach before implementation. --- 🤖 *Automated issue analysis by github-manager* -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
