refactor(providers): share one lease table across cloud device providers

未关闭
#4,102 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
backend

调研方向

Start by reading the lease bookkeeping in provider-limrun and the review findings in #4092 to understand the existing rules. Extract the shared lease table, migrate limrun without behavior changes, then move provider-revyl to it and remove duplicate bookkeeping. Run the relevant provider tests; done means both providers share the table and the typed cleanup-pending outcome is used when a stop is unconfirmed.

由索引模型根据 Issue 内容生成。

描述

in-progress

provider-limrun and the new provider-revyl (#4092) each keep their own lease state: allocate once per lease, track in-flight allocations, release only after the provider confirmed the stop, drain on shutdown, bound work by the caller's deadline, and recover expired leases. Each provider re-implements these rules, so each one can get a different rule wrong. In #4092, most review findings were about this bookkeeping, not about Revyl itself.

Proposal: extract one provider lease table that owns these rules, with a typed provider-cleanup-pending outcome when a stop is not confirmed. A provider would supply only start, stop by lease, find by lease, and its interactor.

Order:

  1. Extract the table from provider-limrun and migrate limrun onto it with no behavior change.
  2. Move provider-revyl onto the same table.
  3. Delete the per-provider lease bookkeeping.

Decided on #4092: Revyl lands first, and this refactor follows.

主要语言
TypeScript
星标
5.3k
派生
377
平均合并
13 小时 49 分钟
30 天内合并 PR
650

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

callstack/agent-device 的其他 Issue

查看 callstack/agent-device 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。