[ISSUE #10726] Avoid raw heartbeat sync body logs - #10727
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
RockteMQ-AI
left a comment
There was a problem hiding this comment.
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 dataoutside thetryblock to make it available in thecatchfor the summary is a clean pattern. The null check insummarizeHeartbeatMessagehandles parse failures gracefully. - [Info] Using
StringBuilderinstead of string concatenation is appropriate here given the conditional sections. - [Info] The summary correctly caps at
subscriptionCount=Nwithout exposing individual subscription expressions or tags.
Suggestions
- Minor: consider also including
localProxyIdin the summary whendata != 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
left a comment
There was a problem hiding this comment.
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
datavariable 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
left a comment
There was a problem hiding this comment.
Summary
Defensive fix with proper validation and test coverage. LGTM.
Automated review by github-manager-bot
|
Consolidated into #10805 to keep heartbeat and system-message sync logging changes in one review. |
Summary
Fixes #10726
Tests