Skip to content

Stop auto_visibility_timeout breaking on short visibility timeouts#1021

Draft
mensfeld wants to merge 3 commits into
mainfrom
fix/auto-extend-short-visibility
Draft

Stop auto_visibility_timeout breaking on short visibility timeouts#1021
mensfeld wants to merge 3 commits into
mainfrom
fix/auto-extend-short-visibility

Conversation

@mensfeld

Copy link
Copy Markdown
Collaborator

AutoExtendVisibility scheduled its TimerTask at
visibility_timeout - EXTEND_UPFRONT_SECONDS (5s). When the queue's visibility timeout was <= 5s that interval was <= 0, so TimerTask#initialize raised ArgumentError before the worker ran - every message failed and was reprocessed (re-failing) until it hit a DLQ.

The extension interval is now clamped to half the visibility timeout when it would be non-positive, so the timer still fires before the message becomes visible again. The extension is skipped with a clear warning only when the visibility timeout is <= 0. Either way the worker now always runs.

Coverage:

  • integration spec with a 5s visibility timeout and an auto_visibility_timeout worker, asserting the message is processed (pre-fix it never was - processing crashed before the worker)
  • unit specs that a too-short timeout runs the worker instead of raising, and a zero timeout warns and skips the extension

AutoExtendVisibility scheduled its TimerTask at
visibility_timeout - EXTEND_UPFRONT_SECONDS (5s). When the queue's
visibility timeout was <= 5s that interval was <= 0, so
TimerTask#initialize raised ArgumentError before the worker ran - every
message failed and was reprocessed (re-failing) until it hit a DLQ.

The extension interval is now clamped to half the visibility timeout
when it would be non-positive, so the timer still fires before the
message becomes visible again. The extension is skipped with a clear
warning only when the visibility timeout is <= 0. Either way the worker
now always runs.

Coverage:
- integration spec with a 5s visibility timeout and an
  auto_visibility_timeout worker, asserting the message is processed
  (pre-fix it never was - processing crashed before the worker)
- unit specs that a too-short timeout runs the worker instead of
  raising, and a zero timeout warns and skips the extension
@mensfeld mensfeld self-assigned this Jun 14, 2026
@mensfeld mensfeld added the bug label Jun 14, 2026
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 891684c8-c000-4f9f-a360-9ac9b754d877

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/auto-extend-short-visibility

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant