Skip to content

Enforce fail_after in Batch#mark_retryable - #12

Merged
Clark-Thanx merged 1 commit into
masterfrom
ord867-batch-fail-after-check
Aug 23, 2026
Merged

Clark-Thanx merged 1 commit into
masterfrom
ord867-batch-fail-after-check

Conversation

@Clark-Thanx

Copy link
Copy Markdown

A notification retrying a dropped connection could retry forever with no way to stop it — neither entry point that most transports actually use ever checked fail_after. ORD-867 root cause; nexus side sets fail_after at creation in nexus#1512, but that value was never being read for apnsp8/apns2.

The gap: connection_lost, service_unavailable, and the batch-level ECONNRESET/timeout rescues (apnsp8 and apns2 alike) call Batch#mark_retryable directly. Only Delivery#mark_retryable checks fail_after — and only FCM's retry path reaches that method. Every iOS retry path bypasses the check entirely.

The fix: move the check into Batch#mark_retryable itself — the one place mark_all_retryable also loops back into, so every transport's retry path reaches it uniformly instead of needing the check duplicated across each Delivery subclass.

✅ Verified: ADAPTER=sqlite3 bundle exec rspec spec/unit/daemon/ — 454 examples, 0 failures, 1 pre-existing pending (unrelated FCM spec, already pending before this change).

…ry path shares.

connection_lost, service_unavailable, and the batch-level ECONNRESET/timeout
rescues (apnsp8 and apns2 alike) call Batch#mark_retryable directly, bypassing
Delivery#mark_retryable's own fail_after check entirely — only FCM's retry
path reaches that check today. A notification whose connection keeps
dropping retries every ~10s forever, with no way to stop it: neither the
per-notification nor the batch-level entry point ever consults fail_after.

mark_all_retryable already loops back into mark_retryable per-notification,
so moving the check here reaches every transport uniformly instead of
duplicating it across each Delivery subclass's rescue blocks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ENCThkiQAQ4zF699fuaHG
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 40 minutes.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 54 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d1c42216-cb59-41fd-a339-bb20d18f901f

📥 Commits

Reviewing files that changed from the base of the PR and between 74f7afc and 69f239e.

📒 Files selected for processing (2)
  • lib/rpush/daemon/batch.rb
  • spec/unit/daemon/batch_spec.rb

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

@Clark-Thanx
Clark-Thanx requested a review from drn August 23, 2026 22:34
@Clark-Thanx
Clark-Thanx merged commit 380ca19 into master Aug 23, 2026
1 of 17 checks passed
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