[ISSUE #10278] Add enableGrpcChannelReceiptHandleRenew switch to disable proxy periodic handle renewal for gRPC clients#10279
Draft
qianye1001 wants to merge 2 commits intoapache:developfrom
Conversation
…o disable proxy periodic handle renewal for gRPC clients - Add enableGrpcChannelReceiptHandleRenew config in ProxyConfig (default true for backward compatibility) - When disabled, use group's consumeTimeoutMinute as invisibleTime for gRPC clients instead of short defaultInvisibleTimeMills - Skip periodic changeInvisibleTime renewal in DefaultReceiptHandleManager only for GrpcClientChannel when disabled - Still save handles and monitor client connectivity for disconnect cleanup (nack)
00c9f8d to
b6eb654
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #10279 +/- ##
=============================================
- Coverage 48.91% 48.88% -0.04%
+ Complexity 13455 13445 -10
=============================================
Files 1375 1375
Lines 100448 100469 +21
Branches 12971 12976 +5
=============================================
- Hits 49137 49112 -25
- Misses 45308 45346 +38
- Partials 6003 6011 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Which Issue(s) This PR Fixes
Brief Description
This PR adds a new dynamic switch
enableGrpcChannelReceiptHandleRenewinProxyConfigto allow disabling the proxy's periodic receipt handle renewal mechanism specifically for gRPC (GrpcClientChannel) consumers.Background: The current auto-renew approach uses a short invisible time (~60s) and periodically calls
changeInvisibleTimeto extend it. While this protects against client crashes, it has a critical flaw: if the proxy crashes, the client's original handle (issued with short invisible time) has already expired, and the renewed handle is lost in proxy memory. The client cannot ack through another proxy, causing unavoidable duplicate consumption.Changes:
ProxyConfig.enableGrpcChannelReceiptHandleRenew(defaulttrue): New boolean switch targeting only gRPC channels. When set tofalse:consumeTimeoutMinute(fromSubscriptionGroupConfig) as the invisible time during pop for gRPC clients, giving the client a long-lived handle.changeInvisibleTimerenewal calls forGrpcClientChannelinstances only.ReceiveMessageActivity: WhenenableGrpcChannelReceiptHandleRenew=false, resolves the invisible time from the group'sconsumeTimeoutMinuteinstead of the shortdefaultInvisibleTimeMills.DefaultReceiptHandleManager: WhenenableGrpcChannelReceiptHandleRenew=false, the scheduled task still detects client disconnects (and nacks), but skips the periodic renewal loop only for channels that areinstanceof GrpcClientChannel.How Did You Test This Change?
mvn compile -pl proxy -am).DefaultReceiptHandleManagerTestandReceiptHandleProcessorTestcontinue to pass (they test with defaultenableGrpcChannelReceiptHandleRenew=true).