RockteMQ-AI commented on issue #733: URL: https://github.com/apache/rocketmq-spring/issues/733#issuecomment-5259896604
**Issue Evaluation** Category: `bug` | Status: **Confirmed** This is a valid concurrency issue. `ClientServiceProvider` loaded via SPI (`ServiceLoader`) is not thread-safe by default — if multiple threads trigger initialization simultaneously, each may create a separate instance, leading to resource leaks and inconsistent state. **Root Cause:** SPI `ServiceLoader.load()` creates a new iterator each call; the provider instantiation is not cached or synchronized at the framework level. **Impact:** Multi-threaded message sending scenarios may encounter race conditions or duplicate provider initialization. **Severity:** Medium-High A fix should ensure the provider is initialized once (e.g., lazy singleton pattern with double-checked locking or `AtomicReference`). --- *Automated evaluation 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]
