fix: implement InvokeCallback.operationFail() for rocketmq-remoting 5.5.0 compatibility#335
Merged
Merged
Conversation
…0 compatibility rocketmq-remoting 5.5.0 changed InvokeCallback semantics: operationFail() is now called directly when connections fail (null channel, inactive channel, connection timeout). DLedger's lambda callbacks only implemented operationComplete(), using the default no-op operationFail(). This caused CompletableFutures to never complete when connections failed, leading to TimeoutException after 3 seconds and test failures across LeaderElectorTest, AppendAndPushTest, BatchPushTest, CommitIndexTest, and SnapshotManagerTest. Fix: replace all lambda InvokeCallback instances in DLedgerRpcNettyService with anonymous classes that implement both operationComplete() and operationFail(), immediately completing futures with NETWORK_ERROR on failure.
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job 'build'
fix: implement InvokeCallback.operationFail() for rocketmq-remoting 5.5.0 compatibility
Jul 22, 2026
lizhanhui
marked this pull request as ready for review
July 22, 2026 10:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #334 upgraded
rocketmq-remoting5.1.0 → 5.5.0 alongside the fastjson2 migration. The 5.5.0 release addedoperationFail(Throwable)toInvokeCallbackandNettyRemotingClient.invokeAsync()now calls it directly (bypassingoperationComplete) when connections fail — null channel, inactive channel, connection timeout. DLedger's lambda callbacks only implementedoperationComplete, sooperationFailwas a default no-op, leavingCompletableFutures permanently incomplete on any connection failure.Impact: Leader election, heartbeat, vote, push, and snapshot operations would hang for 3 s before
TimeoutException, causing cascading failures in 13 CI tests acrossLeaderElectorTest,AppendAndPushTest,BatchPushTest,CommitIndexTest, andSnapshotManagerTest.Changes
DLedgerRpcNettyService— replace all 6 lambdaInvokeCallbackinstances (heartBeat,vote,append,push,installSnapshot,leadershipTransfer) with anonymous classes that implementoperationFail(), immediately completing the future withNETWORK_ERRORso callers can retry without waiting for the 3 s.get()timeout: