gsxdsm
7420abe80e
FN-7731: add CLI-level lock retry for task show/move commands
Add bounded exponential-backoff retry above the DB layer so `fn task show`/`fn task move` ride out transient SQLite lock contention instead of failing outright or hanging.
- Add packages/cli/src/lock-retry.ts: retries a thunk on SQLite lock errors (via @fusion/core's isSqliteLockError) with exponential backoff capped by a wall-clock deadline (default 15s, override via FUSION_CLI_LOCK_RETRY_MS); non-lock errors propagate immediately; raises LockRetryExhaustedError on deadline exhaustion.
- Wire lock-retry into packages/cli/src/commands/task.ts for the show/move task-store operations, and close the resolved TaskStore for deterministic exit.
- Export isSqliteLockError from packages/core/src/index.ts for CLI reuse.
- Add packages/cli/src/commands/__tests__/task-lock-retry.test.ts covering retry/backoff/deadline/error-passthrough behavior; extend task.test.ts.
- Document the new behavior/env var in docs/cli-reference.md.
- Add changeset (@runfusion/fusion: patch).
Files changed:
.changeset/fn-7731-task-cmd-lock-retry.md | 7 +
docs/cli-reference.md | 9 +
.../src/commands/__tests__/task-lock-retry.test.ts | 430 +++++++++++++++++++++
packages/cli/src/commands/__tests__/task.test.ts | 11 +
packages/cli/src/commands/task.ts | 117 +++++-
packages/cli/src/lock-retry.ts | 117 ++++++
packages/core/src/index.ts | 5 +
7 files changed, 688 insertions(+), 8 deletions(-)
Fusion-Task-Id: FN-7731
Fusion-Task-Lineage: 85543164-10d6-4da9-8c3c-a84cd86827aa
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-09 19:58:05 -07:00
..
2026-07-09 19:58:05 -07:00
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-04-18 23:41:47 -07:00
2026-06-20 10:28:25 -07:00