Repository navigation
[ISSUE #11623] Support extension metadata in proxy heartbeat synchronization - #11624
Allenhuangrui wants to merge 5 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #11624 +/- ##
=============================================
+ Coverage 50.86% 51.37% +0.50%
- Complexity 14881 15053 +172
=============================================
Files 1391 1391
Lines 103773 103969 +196
Branches 13614 13649 +35
=============================================
+ Hits 52789 53409 +620
+ Misses 44724 44297 -427
- Partials 6260 6263 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| channel = remoteChannelMap.getOrDefault(key, decodedChannel); | ||
| } | ||
| channel.setExtendAttribute(decodedChannel.getChannelExtendAttribute()); | ||
| processHeartbeatData(data, channel); |
There was a problem hiding this comment.
The receive hook can change data.getGroup() after the remote channel cache key has been computed, and catching a hook exception does not undo that change. Could the hook receive only the extension metadata so the cache and consumer registration always use the same group?
There was a problem hiding this comment.
The hook currently receives the mutable heartbeat DTO after the cache key is computed, so changing the group can make the cache key and the consumer operation disagree; catching an exception does not restore it. I’ll narrow the receive hook to the original group string, extension metadata, and the resolved RemoteChannel, without exposing the DTO. The group is needed to scope the channel-attached integration metadata. I’ll also strengthen the regression tests for registration, unregistration, and hook failures. The wire format will remain unchanged.
There was a problem hiding this comment.
Updated in f3c384d. Neither hook receives HeartbeatSyncerData now:
- The send hook receives the original group and a mutable copy of extInfo. The copy is written back only after a successful callback, so partial extension updates are discarded on failure.
- The receive hook receives the original group, extInfo, and the actual RemoteChannel used for registration/unregistration. Keeping the channel lets extensions attach connection metadata before consumer events run; the mutable heartbeat DTO stays private to the syncer.
Added regression coverage for extension keys resembling core fields, callback failures, channel reuse and cache cleanup, and empty extensions. The wire format is unchanged. Runtime verification is still pending because the remote test environment is unavailable; this revision has passed git diff --check.
Which Issue(s) This PR Fixes
Fixes #11623
Brief Description
Allow proxy integrations to propagate optional consumer metadata through heartbeat synchronization without duplicating the heartbeat sender/receiver or overloading protocol-specific channel data.
Map<String, String> extInfotoHeartbeatSyncerData.HeartbeatSendHandlerandHeartbeatReceiveHandlercallbacks, configurable throughHeartbeatSyncerandClusterConsumerManager. Both exposeaccept(String group, Map<String, String> extInfo, Channel channel); neither receives the mutable heartbeat DTO.RemoteChannel, exposed through theChannelinterface, before consumer registration/unregistration. It can attach connection metadata without changing the heartbeat's group, client ID, or event type. Declaring both parameters asChannelleaves the runtime objects and channel reuse unchanged.How Did You Test This Change?
7069a165ac4576555a39fda4551e302a28d1d1d6, all 16 tests inHeartbeatSyncerDataTest,HeartbeatSyncerExtInfoTest, andHeartbeatSyncerTestpassed in a remote Kubernetes test pod on Linux amd64 / JDK 21 using the available dependency classpath.javac --release 8. This focused run is not a clean full Maven build.HeartbeatSyncer.java, the only file changed in the latest revision, using the repository configuration.git diff --checkpassed.LocalGrpcIT.testSimpleConsumerSendAndRecvPriorityMessageandOffsetResetForPopIT.testResetOffsetThenAckOldForPopOrderly); those tests were not changed. No full-CI success is claimed.