Skip to content

Don't throw errors when we shut down the loadbalancer watcher#2757

Merged
dwwoelfel merged 3 commits into
mainfrom
quiet-fail
Jun 11, 2026
Merged

Don't throw errors when we shut down the loadbalancer watcher#2757
dwwoelfel merged 3 commits into
mainfrom
quiet-fail

Conversation

@dwwoelfel

Copy link
Copy Markdown
Contributor

This catches the interrupted exceptions that get thrown when we stop the loadbalancer watcher.

Should makes deploys a little less noisy.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: def4bcd4-e88f-4dca-b425-b747836cb29d

📥 Commits

Reviewing files that changed from the base of the PR and between fd84a00 and 62e2487.

📒 Files selected for processing (1)
  • server/src/instant/loadbalancer.clj
💤 Files with no reviewable changes (1)
  • server/src/instant/loadbalancer.clj

📝 Walkthrough

Walkthrough

Poll loop now accepts a shutdown predicate and conditionally suppresses interrupt-related exceptions and tracer spans; create-process supplies and sets a shutdown flag so the polling loop can terminate cleanly during shutdown.

Changes

Interrupt Signal Handling in SQS Polling

Layer / File(s) Summary
poll-queue refactor and exception import
server/src/instant/loadbalancer.clj
Adds InterruptedException import and changes poll-queue to accept shutdown?, wraps the loop in a try/catch for InterruptedException (suppressing it when shutting down, rethrowing otherwise), narrows the inner catch to Exception, and makes error handling exit immediately on shutdown versus recording a tracer span and backing off when not shutting down.
create-process shutdown wiring
server/src/instant/loadbalancer.clj
Creates a shutdown-atom and shutdown? accessor in create-process, passes shutdown? into poll-queue, and sets the atom in the returned shutdown callback so the poller can observe shutdown.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: preventing errors from being thrown during loadbalancer watcher shutdown, which matches the refactoring to handle InterruptedException cleanly.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of catching interrupted exceptions during shutdown to reduce deployment noise.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch quiet-fail

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@server/src/instant/loadbalancer.clj`:
- Around line 112-117: In poll-queue's inner (catch Throwable t) block, don’t
swallow interruption-related exceptions by returning :backoff; instead detect if
t is an InterruptedException or an AbortedException whose cause is an
InterruptedException and rethrow t so the outer InterruptedException handler can
terminate the loop. For non-interruption errors, keep calling
tracer/record-exception-span! and return :backoff as before; reference the catch
handling around poll-queue, the InterruptedException and AbortedException
checks, and tracer/record-exception-span! when making the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 79155b42-5722-4c6b-b3cd-f80ff32525e0

📥 Commits

Reviewing files that changed from the base of the PR and between 090bb42 and 89ff7a3.

📒 Files selected for processing (1)
  • server/src/instant/loadbalancer.clj

Comment thread server/src/instant/loadbalancer.clj Outdated
Comment thread server/src/instant/loadbalancer.clj Outdated

@nezaj nezaj 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.

LGTM!

@dwwoelfel dwwoelfel merged commit 2e97f48 into main Jun 11, 2026
34 checks passed
@dwwoelfel dwwoelfel deleted the quiet-fail branch June 11, 2026 22:53
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.

2 participants