Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

A lease renew right after a gateway restart answers UNKNOWN_LEASE and the client drops the lease

オープン
#983 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript

調査の方向性

Start with the lease lookup in src/gateway/lease-index.ts and the rebuild flow in src/gateway/fleet-coordinator.ts; then read ADR 0005 §§16 and 30 and the renewal policy in src/lease-policy/index.ts. Check how the proposed rebuilding-window behavior fits the reported fixed 60-second fallback and known-worker persistence in src/gateway/drain-store.ts. Done means a renewal during rebuild gets a retryable WORKER_UNREACHABLE response and the client keeps the lease.

索引モデルが issue の本文から書いたものです。

説明

What happened

After a gateway restart (including a self-update), a lease.renew that arrives before the lease's worker has reported answers UNKNOWN_LEASE. The gateway looks every id up only in its lease index, which is empty until each worker reports (src/gateway/lease-index.ts:14-20, src/gateway/fleet-coordinator.ts:1410-1418). CLI and MCP renewal treat UNKNOWN_LEASE as final (src/lease-policy/index.ts:187-189) and drop the lease.

The device stays held on the worker until its TTL. Once the index is rebuilt, the requester's next lease request is refused with REQUESTER_ALREADY_LEASED, naming the orphan.

What you expected

ADR 0005 §16 and §30: clients "simply resume renewing" after a gateway restart. A renew in the rebuild window gets a retryable error (WORKER_UNREACHABLE), and the lease survives.

How to reproduce
  1. Gateway with one worker; an agent leases a device through the gateway.
  2. Restart the gateway (or let it self-update).
  3. Renew the lease within roughly 15–40 s, before the worker's first report: UNKNOWN_LEASE, and the client drops the lease.
Environment

main at 7a2f0b33a. Found by reading code in the #412 review, not by a user report.

Logs and evidence

From the #412 review, finding R1. Proposed fix there: answer WORKER_UNREACHABLE for an id the index does not hold while the fleet is rebuilding. The window ends when every known worker has reported. ADR 0005 decision 5 says known worker ids are persisted, but only drained ids are (src/gateway/drain-store.ts:20). The fallback is a fixed 60 s window. The same window also fixes R3, R5 and R8.

Written by an agent.

主要言語
TypeScript
スター
22
フォーク
2
平均マージ
7時間 38分
マージ済み PR(30日)
413

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

callstackincubator/simlock のほかの issue

callstackincubator/simlock の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。