Skip to content

fix: harden GrpcClientSettingsManager offline cleanup diagnostics - #10719

Open
Aias00 wants to merge 3 commits into
apache:developfrom
Aias00:fix/proxy-settings-cleaner-log-summary
Open

fix: harden GrpcClientSettingsManager offline cleanup diagnostics#10719
Aias00 wants to merge 3 commits into
apache:developfrom
Aias00:fix/proxy-settings-cleaner-log-summary

Conversation

@Aias00

@Aias00 Aias00 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Skip Lite consumer offline cleanup when the persisted settings contain no subscriptions.
  • Summarize client settings in both offline cleanup and removed-settings diagnostics.
  • Avoid serializing Settings protobuf payloads while retaining client and failure context.

Validation

mvn -q -pl proxy -am -Dtest=GrpcClientSettingsManagerTest -DfailIfNoTests=false test

Closes #10718
Closes #10710
Closes #10681

Copilot AI review requested due to automatic review settings July 31, 2026 08:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@RockteMQ-AI

Copy link
Copy Markdown
Contributor

Review by github-manager-bot

Summary

This PR replaces raw Settings protobuf object logging in GrpcClientSettingsManager when removing unused client settings. Instead of logging the full Settings object (which may contain sensitive topic/group names), it now logs a summary with only clientType, publishingTopicCount, and subscriptionCount.

Changes Reviewed

  • proxy/src/main/java/.../GrpcClientSettingsManager.java — added summarizeClientSettings() helper, updated log statement
  • proxy/src/test/java/.../GrpcClientSettingsManagerTest.java — added test verifying no resource names leak into summary

Assessment

✅ Correctness — Logic is correct. Null check is in place. The hasPublishing()/hasSubscription() guards prevent NPE on missing optional fields.

✅ Performance — No concerns. Only called in the cleanup path.

✅ Tests — Good test coverage. The test explicitly verifies that sensitive topic names ("sensitive-publish-topic", "sensitive-subscribe-topic") do not appear in the summary output, and that null input returns "null".

✅ Compatibility — No public API changes. Package-private static method.

Suggestion

Same as #10721: the summarizeClientSettings() logic here is identical to summarizeSettings() in GrpcClientChannel and ClientActivity. Consider consolidating into a shared utility to avoid maintaining 3 copies of the same logic.

Overall: Looks good. 👍

@codecov-commenter

codecov-commenter commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.53846% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.51%. Comparing base (293f588) to head (81e7b00).

Files with missing lines Patch % Lines
...roxy/grpc/v2/common/GrpcClientSettingsManager.java 61.53% 6 Missing and 4 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10719      +/-   ##
=============================================
- Coverage      48.62%   48.51%   -0.12%     
+ Complexity     13692    13658      -34     
=============================================
  Files           1381     1381              
  Lines         101464   101488      +24     
  Branches       13187    13192       +5     
=============================================
- Hits           49337    49235     -102     
- Misses         46142    46239      +97     
- Partials        5985     6014      +29     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by github-manager-bot

Summary

Replaces raw Settings protobuf logging with compact summaries in GrpcClientSettingsManager, and fixes a latent bug where consumerGroupInfo (the whole object) was logged instead of consumerGroup (the string name).

Findings

  • [Info] proxy/src/main/java/.../GrpcClientSettingsManager.java — Good bug fix: the original consumerGroupInfo in the log was logging the full object reference, not the group name. Changing to consumerGroup is correct.
  • [Info] The summarizeSettings() method is duplicated across 3 PRs (#10721, #10719, #10717). See suggestion in #10721 for a shared utility class.
  • [Info] Test coverage for summarizeSettings() and getAttributeLength() is thorough, covering null, empty, and populated cases.

Suggestions

  • Same as #10721: consider extracting summarizeSettings() to a shared utility.

Verdict

LGTM. Good sanitization + bonus bug fix.


Automated review by github-manager-bot

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by github-manager-bot

Summary

Replaces raw Settings protobuf in the "remove unused grpc client settings" log with a summarizeClientSettings() summary. Also adds clientId to the log for better traceability.

Findings

  • [Info] GrpcClientSettingsManager.java:285 — Adding clientId to the log is a good improvement for correlating settings removal with specific clients.
  • [Info] GrpcClientSettingsManager.java:296-303 — summarizeClientSettings() implementation is identical to summarizeSettings() in PR #10721 (GrpcClientChannel). Consider consolidating.
  • [Info] Test coverage validates null, empty, and populated Settings cases.

Cross-repo Note

Same summarization logic as PRs #10721 and #10717. A shared utility would prevent drift.


Automated review by github-manager-bot

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Defensive fix with proper validation and test coverage. LGTM.


Automated review by github-manager-bot

@Aias00 Aias00 changed the title [ISSUE #10718] Summarize removed client settings logs fix: summarize GrpcClientSettingsManager diagnostics Aug 15, 2026
@Aias00
Aias00 force-pushed the fix/proxy-settings-cleaner-log-summary branch from 731228a to 7dce94e Compare August 15, 2026 07:27
@Aias00 Aias00 changed the title fix: summarize GrpcClientSettingsManager diagnostics fix: harden GrpcClientSettingsManager offline cleanup diagnostics Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants