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

Đang mở
#4,102 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
5.3k
Fork
377
Merge trung bình
13 giờ 49 phút
Pull request đã merge (30 ngày)
650

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của callstack/agent-device

Tất cả issue của callstack/agent-device

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.