stable · guide · 0.1.0
Failure、retry、quota 與 cancellation
Invocation lifecycle
以 GET /scheduled-invocations/{invocationId}
觀察單次執行:
| Status | 意義 |
|---|---|
pending |
等待 scheduled_for 與 worker claim |
processing |
worker 持有有期限的 lease |
retry |
retryable failure,等待 available_at |
succeeded |
Project Backend 已成功處理 |
dead_letter |
嘗試耗盡,需要人工對帳 |
cancelled |
schedule cancellation 終止尚未完成的 invocation |
Worker failure 不會刪除 PostgreSQL durable operation。Lease 到期後可重新 claim;Project Backend 因此必須以 invocation ID 實作冪等。
Recurring、quota 與 cancellation
GET /invocation-schedules/{scheduleId}
會列出所有 invocation、attempts 與 last_error_code。Recurring invocation 成功後才建立下一次;若單次 invocation 進入 dead-letter,下一次仍依原 interval 排程。
平台 quota 用盡時 schedule 進入 quota_paused,quota 物件提供 resource、used、limit 與 retry_at。到期後平台可恢復 schedule,已成功的 invocation 不會重跑。
DELETE /invocation-schedules/{scheduleId}
是冪等操作,會把 schedule 標記為 cancelled,並終止尚未完成的 invocation;已成功的結果保留。