Skip to content

A queued retry goes at once when the clock moves back past its failure - #742

Merged
SunkenInTime merged 1 commit into
mainfrom
t3/retry-clock-back
Nov 24, 2026
Merged

SunkenInTime merged 1 commit into
mainfrom
t3/retry-clock-back

Conversation

@SunkenInTime

Copy link
Copy Markdown
Owner

No picture: this is the cloud queue's package. Only desktop driver builds use the store's sender so far.

Fixes #741. A retry's backoff is measured from the wall-clock time of the last failure. Before this, if the device clock moved back after a send failed, the entry was held until the clock passed that old time plus the backoff. A clock moved back a day turned a 600 ms wait into a day.

The fix. RetryAfter now also carries the failure time. When the clock reads earlier than that time, the clock has moved back and the wait cannot be measured, so the entry is not held and goes at once. The view is re-derived when the clock reaches the failure time again, so a send made before then follows the usual backoff. The package still owns no clock. A clock step back can now shorten one wait; it cannot stretch one.

Tests

  • cloud_queue_test.dart, a retry waiting out its backoff goes at once when the clock moves back past its failure, instead of waiting for the clock to catch up. Fails without the fix.
  • cloud_model_test.dart:
    • The model gains a backward clock step of 1 s or 1 day. The server's time does not move with it. Minimum 50 steps; about 320 happen in a default run.
    • seed 7: after the device clock moves back a day, a retry waiting out its backoff goes, so the queue drains runs seed 7 in both folding modes. Without the fix it fails with did not drain: op39 unanswered (1 failures, retry after …).
    • The after-every-step stall check now reads what an op waits for in up to three rounds, page list first. The new clock steps produced a page delete whose first read turned its wait from the page into the page list and the page. Reading one hold's subject once could not settle that.

Package: dart analyze is clean with infos included, and all 1,060 tests pass. The app's library_store tests pass (348), and so does the comments check.

#740's model drain had an allowance that waited such a retry out. It should come out when that branch is next rebased; #740 itself is on hold.

ci: library

…e goes at once, instead of waiting for the clock to catch up
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 24c01d2f-f129-4309-badc-808825e0405a
Commits

Reviewing files that changed from the base of the PR and between d7c37dc and e126759.

Files selected for processing: 5

  • packages/icarus_library/README.md
  • packages/icarus_library/lib/src/cloud/derivation.dart
  • packages/icarus_library/lib/src/cloud/queue.dart
  • packages/icarus_library/test/cloud_model_test.dart
  • packages/icarus_library/test/cloud_queue_test.dart
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@SunkenInTime
SunkenInTime merged commit ee5f88c into main Nov 24, 2026
19 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.

A queued retry waits for the clock to catch up after the device clock moves back

1 participant