Repository navigation
[Go] Fix inverted hook status in Ack/DLQ methods - #1269
Conversation
The messageHookPointsStatus was incorrectly initialized to ERROR and set to OK when the response code was not OK, which is the opposite of the intended behavior. This affected three locations: - push_consumer.go: Ack() - push_consumer.go: ForwardMessageToDeadLetterQueue() - simple_consumer.go: Ack() Also set status to ERROR before early return on err != nil, so that the hook always reports the correct status on failure.
e0c4c7b to
b46d9a9
Compare
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by RockteMQ-AI
Summary
Fixes inverted hook status initialization in Ack/DLQ methods.
Findings
- [Good] golang/push_consumer.go:584 β Initializes status to OK instead of ERROR
- [Good] golang/push_consumer.go:586-588 β Sets status to ERROR on failure (correct logic)
- [Good] golang/push_consumer.go:591 β Sets status to ERROR when response code is not OK
- [Good] golang/push_consumer.go:636-646 β Same fix applied to ForwardMessageToDeadLetterQueue
- [Good] golang/simple_consumer.go:452-461 β Same fix applied to SimpleConsumer.Ack
Analysis
The bug was a logic inversion:
- Original: Initialize to ERROR, set to OK when response is not OK (backwards!)
- Fixed: Initialize to OK, set to ERROR on failure (correct!)
This aligns with the pattern used in changeInvisibleDuration0 and ensures hooks receive accurate status information for monitoring and metrics.
The fix is applied consistently across all three affected methods (PushConsumer.Ack, PushConsumer.ForwardMessageToDeadLetterQueue, SimpleConsumer.Ack).
Verdict
Approve β Correct fix for inverted status logic.
Automated review by RockteMQ-AI
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved β
PR: #1269 β [Java] Fix missing return after retry scheduling in process_queue
Type: Bug fix (1 file, +3/-0)
Assessment
Fixes fall-through bugs where retry scheduling functions were called but execution continued, causing premature cache eviction and potential message loss.
Verdict
β Critical fix preventing message loss. Companion to Go/C# fixes (#1264, #1265, #1267, #1268).
π€ Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved β
PR: #1269 β [Java] Fix missing return after retry scheduling in process_queue
Type: Bug fix (1 file, +3/-0)
Assessment
Fixes fall-through bugs where retry scheduling functions were called but execution continued, causing premature cache eviction and potential message loss.
Verdict
β Critical fix preventing message loss. Companion to Go/C# fixes (#1264, #1265, #1267, #1268).
π€ Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved β
PR: #1269 β [Go] Fix inverted hook status in Ack/DLQ methods
Type: Bug fix (2 files, +9/-6)
Assessment
Fixes inverted messageHookPointsStatus in Ack/DLQ hook locations. Previously initialized to ERROR and set to OK on failure β opposite of intended behavior.
Verdict
β Critical fix for hook status correctness.
π€ Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved β
PR: #1269 β [Go] Fix inverted hook status in Ack/DLQ methods
Type: Bug fix (2 files, +9/-6)
Assessment
Fixes inverted messageHookPointsStatus in Ack/DLQ hook locations. Previously initialized to ERROR and set to OK on failure β opposite of intended behavior.
Verdict
β Critical fix for hook status correctness.
π€ Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved β
PR: #1269 β [Go] Fix inverted hook status in Ack/DLQ methods
Type: Bug fix (2 files, +9/-6)
Assessment
Fixes inverted messageHookPointsStatus in Ack/DLQ hook locations. Previously initialized to ERROR and set to OK on failure β opposite of intended behavior.
Verdict
β Critical fix for hook status correctness.
π€ Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved β
PR: #1269 β [Go] Fix inverted hook status in Ack/DLQ methods
Type: Bug fix (2 files, +9/-6)
Assessment
Fixes inverted messageHookPointsStatus in Ack/DLQ hook locations. Previously initialized to ERROR and set to OK on failure β opposite of intended behavior.
Verdict
β Critical fix for hook status correctness.
π€ Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved β
PR: #1269 β [Go] Fix inverted hook status in Ack/DLQ methods
Type: Bug fix (2 files, +9/-6)
Assessment
Fixes inverted messageHookPointsStatus in Ack/DLQ hook locations. Previously initialized to ERROR and set to OK on failure β opposite of intended behavior.
Verdict
β Critical fix for hook status correctness.
π€ Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved β
PR: #1269 β [Go] Fix inverted hook status in Ack/DLQ methods
Type: Bug fix (2 files, +9/-6)
Assessment
Fixes inverted messageHookPointsStatus in Ack/DLQ hook locations. Previously initialized to ERROR and set to OK on failure β opposite of intended behavior.
Verdict
β Critical fix for hook status correctness.
π€ Automated review by oss-sentinel-ai
Summary
messageHookPointsStatusin three Ack/DLQ hook locations was incorrectly initialized toERRORand set toOKwhen the response code was notCode_OKβ the exact opposite of the intended behavior.OKand switching toERRORon failure, consistent with the pattern used inchangeInvisibleDuration0.push_consumer.go:Ack()andForwardMessageToDeadLetterQueue()simple_consumer.go:Ack()