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

Aberta
#4,102 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Refatoração
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
typescript
Domínio
backend

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
5.3k
Forks
377
Merge médio
13h 49min
PRs com merge (30d)
650

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de callstack/agent-device

Todas as issues de callstack/agent-device

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.