Duplicate RPC callback and unnecessary lock in RequestResponseFuture
wgdzlh opened this issue · comments
BUG REPORT
- Should only invoke callback when rrf is timout, as in Java client, or the callback will be called twice when RPC is finished normally:
rocketmq-client-go/internal/request_response_future.go
Lines 54 to 57 in 6c77b67
-
Since we already use chan
Done
to sync the write and read of response message, there is no need to use mutex:
rocketmq-client-go/internal/request_response_future.go
Lines 133 to 145 in 6c77b67
-
Consider edge cases, we should add non-blocking check of chan Done before calculate timeout, to avoid any possibility of duplicate callback:
rocketmq-client-go/internal/request_response_future.go
Lines 147 to 150 in 6c77b67