feat(async): add retry_async over TimerQueue and deadline-domain conformance (M-TIME-03 B1b)
- NEW Async/Retry.hpp: retry_async drives RetryState with the TimerQueue's injected clock, awaits backoff via sleep_until, resumes only after a clean sleep (any sleep error ends the retry), preserves success after stop, supports Task-returning and move-only callables - Tests: AsyncRetry (15), DeadlineDomains blocking-retry manual-clock case Review: W11-REVIEW-B1b READY (deviation accepted; doc fix applied by root) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3ce21be53a
commit
5c24f8e84f
5 files changed
+1555
-3
No files matched your search
@@ -152,7 +152,7 @@ Decisions: D-033..D-036.
|
||||
| --- | --- | --- | --- | --- |
|
||||
| W11-PLAN | Architecture/task plan + REV1 addendum | [W11-PLAN](tasks/W11-PLAN.md), [output](tasks/W11-PLAN-OUTPUT.md), [REV1](tasks/W11-PLAN-REV1-OUTPUT.md) | DONE | PREFLIGHT 1 CHANGES_REQUIRED ([findings](tasks/W11-PREFLIGHT-OUTPUT.md)); resolved in REV1/D-038; PREFLIGHT 2 running |
|
||||
| M-FUNCTIONAL-03 | Pure retry decisions + named blocking adapter (A1) | [spec](tasks/M-FUNCTIONAL-03.md) | VERIFIED (`26edf65`) | Review W11-REVIEW-A1 READY (P3 1/2/5 fixed by root); ResilienceAsync subset 475 (472 ✔, 3 ⊘), filtered 43/43, ctest 2/2, TSan 40/40 0 races, ASan+UBSan 40/40, `-Werror` syntax checks clean |
|
||||
| M-TIME-03 | Injected-deadline domains: TimerQueue + clock saturation (B1); `retry_async` (B1b) | [spec](tasks/M-TIME-03.md), [B1b](tasks/M-TIME-03-B1b.md) | B1 VERIFIED; B1b IN REVIEW (root-verified 697: 694 ✔ 3 ⊘, TSan 33/33) | B1: review W11-REVIEW-B1 F1–F3 fixed by root; Runtime;SystemAsync;ResilienceAsync 681 (678 ✔, 3 ⊘), TSan 28/28 ×3, ASan 468 ✔, post-fix 18/18 + TSan 15/15 |
|
||||
| M-TIME-03 | Injected-deadline domains: TimerQueue + clock saturation (B1); `retry_async` (B1b) | [spec](tasks/M-TIME-03.md), [B1b](tasks/M-TIME-03-B1b.md) | VERIFIED | B1b: review W11-REVIEW-B1b READY (deviation accepted, spec amended, doc P3-3 fixed); root 697 (694 ✔, 3 ⊘), TSan 33/33, reviewer ASan 33/33 + TSan 5×15/15 | B1: review W11-REVIEW-B1 F1–F3 fixed by root; Runtime;SystemAsync;ResilienceAsync 681 (678 ✔, 3 ⊘), TSan 28/28 ×3, ASan 468 ✔, post-fix 18/18 + TSan 15/15 |
|
||||
| M-ASYNC-04 | ThreadExecutor, FuturePool, AsyncChannel, bounded ParallelFor (A2) + root fixes: pre-existing `spawn()` eager-frame race in `Executor.hpp`, ParallelFor runner last-reference ownership | [spec](tasks/M-ASYNC-04.md) | IN REVIEW | Implementer: 109/109, TSan 46/46, ASan 46/46; root: TSan 6/6 runs 47/47 after fixes, spawn regression test added |
|
||||
| M-ASYNC-05 | EventBus/Observable snapshot dispatch, joined subscriptions (A3) | [spec](tasks/M-ASYNC-05.md) | READY (after M-ASYNC-04 commit) | — |
|
||||
| S-IO-03 | Bounded positional file workers, sync, active-cancel, shutdown core, D1 fixes (B2) | [spec](tasks/S-IO-03.md) | IN REVIEW | Implementer: IO 37/37, TSan 37/37 + 30 loops, ASan clean, downstream 883 ✔; root: full 55-module `-Werror` 1,574 (1,570 ✔, 4 ⊘), ctest 2/2, IO-users TSan 627 (624 ✔, 3 ⊘), 0 TSan warnings |
|
||||
@@ -201,3 +201,4 @@ specs' observed baselines (D-035); not separately scheduled.
|
||||
| VL-CRYPTO-02 | P1 | `pbkdf2_hmac_sha256(password, salt, iterations, out_len)` (RFC 8018 §5.2) on the builtin HMAC path; RFC 7914 §11 vectors; bounded iterations/output | PLANNED |
|
||||
| VL-NET-02 | P1 (blocks Forge production email) | Public TLS client stream (TCP+TLS, CA + hostname verification, STARTTLS upgrade) + minimal SMTP submission client (EHLO, STARTTLS-required or implicit TLS, AUTH PLAIN over TLS only, MAIL/RCPT/DATA with dot-stuffing, bounded size, deadlines) | PLANNED |
|
||||
| VL-TEXT-01 | P2 | RFC 4648 base32 + Crockford base32 encode/decode | PLANNED |
|
||||
| X-QA-04 | AsyncRetry follow-ups from W11-REVIEW-B1b: race test only exercises the late-stop interleaving (add handshake/alternation); add direct checks of `detail::retry_backoff_stop_reason`; add a throwing-classifier test | W11-REVIEW-B1b P3-1/2/4 | PLANNED |
|
||||
@@ -50,8 +50,10 @@ MANDATORY semantics:
|
||||
`Coro::Task<std::expected<T,E>>` (co_await it). Success → return `T` (also when stop was requested
|
||||
during the attempt). Failure → `next(now, classify(error), stop_requested)`.
|
||||
- On `wait_until(at)`: `co_await timers.sleep_until(at, OperationOptions{options.stop, options.deadline})`.
|
||||
Then ALWAYS call `resume(now, options.stop.stop_requested())` — it re-checks stop itself, which covers
|
||||
the TimerQueue choice where a late stop yields `{}`. Sleep result mapping: `{}` → resume;
|
||||
After a `{}` sleep, ALWAYS call `resume(now, options.stop.stop_requested())` — it re-checks stop itself,
|
||||
which covers the TimerQueue choice where a late stop yields `{}`. Any sleep error ends the retry without
|
||||
calling `resume()` (amended after W11-REVIEW-B1b: resuming after `stopped`/`overloaded` would start
|
||||
attempts with no wait). Sleep result mapping: `{}` → resume;
|
||||
`cancelled` → stop with `stop_requested`; `timeout` → stop with `deadline_exceeded`; `stopped` (queue
|
||||
closed) → stop with `stop_requested` (documented: queue closure aborts the retry; no further attempt);
|
||||
`overloaded` → stop with `stop_requested` and document (no silent busy retry).
|
||||
|
||||
Reference in new issue
Block a user