Skip to content

[ISSUE #10726] Avoid raw heartbeat sync body logs - #10727

Closed
Aias00 wants to merge 1 commit into
apache:developfrom
Aias00:fix/proxy-heartbeat-sync-log-summary
Closed

[ISSUE #10726] Avoid raw heartbeat sync body logs#10727
Aias00 wants to merge 1 commit into
apache:developfrom
Aias00:fix/proxy-heartbeat-sync-log-summary

Conversation

@Aias00

@Aias00 Aias00 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace raw heartbeat sync message/body logging with a compact failure summary
  • include topic, message id, body size, and parsed heartbeat metadata counts when available
  • add tests to ensure subscription expressions, channel data, and unparsed raw bodies are not emitted in the summary

Fixes #10726

Tests

  • JAVA_HOME=$(/usr/libexec/java_home -v 1.8) mvn -pl proxy -Dtest=HeartbeatSyncerTest clean test

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

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.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.75000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.21%. Comparing base (00e45b8) to head (f490127).

Files with missing lines Patch % Lines
...etmq/proxy/service/sysmessage/HeartbeatSyncer.java 68.75% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10727      +/-   ##
=============================================
- Coverage      48.31%   48.21%   -0.10%     
+ Complexity     13511    13476      -35     
=============================================
  Files           1380     1380              
  Lines         101091   101105      +14     
  Branches       13101    13104       +3     
=============================================
- Hits           48844    48751      -93     
- Misses         46285    46364      +79     
- Partials        5962     5990      +28     

☔ 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 heartbeat sync message body logging with a compact summary that includes parsed metadata (heartbeatType, group, clientId, subscriptionCount) when available, while never exposing subscription data details, channel data, or raw body content.

Findings

  • [Info] Moving HeartbeatSyncerData data outside the try block to make it available in the catch for the summary is a clean pattern. The null check in summarizeHeartbeatMessage handles parse failures gracefully.
  • [Info] Using StringBuilder instead of string concatenation is appropriate here given the conditional sections.
  • [Info] The summary correctly caps at subscriptionCount=N without exposing individual subscription expressions or tags.

Suggestions

  • Minor: consider also including localProxyId in the summary when data != null, since the original log included the full data object and the localProxyId comparison is the core business logic of this method. This would aid debugging without exposing sensitive data.
  • Tests are thorough — two test methods cover both the parsed-data and unparsed-body scenarios, with explicit assertions that secrets (secret-tag, secret-channel-data, raw-secret-body) are excluded.

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 heartbeat message body in error logs with a summarizeHeartbeatMessage() that logs only metadata (topic, msgId, bodySize, heartbeatType, group, clientId, subscriptionCount).

Findings

  • [Info] HeartbeatSyncer.java:191 — Moving data variable declaration outside the try block is necessary to include parsed data in the error summary. This is correct and the variable is properly initialized to null.
  • [Info] HeartbeatSyncer.java:226-248 — summarizeHeartbeatMessage() handles both null msg and null data gracefully. When data is parsed, it includes useful diagnostic fields without exposing the full subscription data set.
  • [Info] Test coverage validates null and normal cases.

Suggestions

Clean implementation. The approach of partially parsed data in the summary (when available) is a nice touch for debugging.


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 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

Consolidated into #10805 to keep heartbeat and system-message sync logging changes in one review.

@Aias00 Aias00 closed this Aug 15, 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

Development

Successfully merging this pull request may close these issues.

Avoid logging raw heartbeat sync message body

4 participants