Skip to content

fix(worker): remove dead break in nats consumer select#361

Open
mesutoezdil wants to merge 2 commits into
NVIDIA:mainfrom
mesutoezdil:mesutoezdil/fix/nats-consumer-ineffective-break
Open

fix(worker): remove dead break in nats consumer select#361
mesutoezdil wants to merge 2 commits into
NVIDIA:mainfrom
mesutoezdil:mesutoezdil/fix/nats-consumer-ineffective-break

Conversation

@mesutoezdil

@mesutoezdil mesutoezdil commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

staticcheck flags a dead break in the nats consumer select loop.

Removed two break statements that had no effect.

´Testing
go build, go vet, go test all pass.

Closes #360

The break was the last statement in a select case, so it did nothing.
staticcheck flagged it as an ineffective break (SA4011).

Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
@mesutoezdil
mesutoezdil requested a review from a team as a code owner July 22, 2026 20:37
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

NATS consumer fetch loop

Layer / File(s) Summary
Fetch loop control flow
src/libraries/go/worker/consumer/nats_consumer.go
Removes two ineffective break statements from message receipt and forwarding selects while retaining closed-message and context-cancellation handling.

Estimated code review effort: 2 (Simple) | ~5 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title is well-formed, but 'fix' overstates this no-behavior-change cleanup; it is a refactor/chore to remove dead breaks and silence SA4011. Retitle it as 'refactor(worker): remove dead break in nats consumer select' or 'chore(worker): remove dead break in nats consumer select'.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change removes the two dead break statements in nats_consumer.go and matches issue #360's SA4011 fix.
Out of Scope Changes check ✅ Passed No unrelated changes are present; the diff is limited to the dead-break cleanup in the targeted consumer file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@sbaum1994
sbaum1994 requested a review from shobham-nv July 22, 2026 22:25
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.

worker: dead break statement in nats consumer select

1 participant