yuluo-yx opened a new issue, #10860: URL: https://github.com/apache/rocketmq/issues/10860
## Runtime platform environment macOS; reproduced with a deterministic unit test in the `openmessaging` module. ## RocketMQ version Branch: `develop` Git commit: `fd0c95920e0deac96ce2ae27442747cc5e65e930` ## JDK Version Eclipse Temurin 17.0.19+10 ## Describe the Bug The no-argument `DefaultPromise.get()` returns the current `result` immediately. When the promise is still pending, callers receive `null` instead of waiting for completion. Reading a completed value also calls listeners again through `getValueOrThrowable`, which can duplicate callbacks. ## Steps to Reproduce 1. Create a new `DefaultPromise<String>`. 2. Call `get()` from another thread before completing it. 3. Observe that the call returns `null` immediately. 4. Add a listener, complete the promise, then call `get()`; the listener can be invoked again. ## What Did You Expect to See? `get()` should wait until completion, propagate failures, and listeners should be notified once when the state completes. ## What Did You See Instead? `get()` returns before completion and completed value reads can notify listeners repeatedly. ## Additional Context The timed `get(long)` API already provides the waiting mechanism that the no-argument method can reuse. -- 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]
