Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Remote install: lease is not renewed during artifact upload

未关闭
#2,946 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
android, ios, typescript

调研方向

Start in src/cli/commands/connection-runtime.ts at allocateOrReuseLease, then trace prepareRemoteRequestArtifacts and uploadArtifact through src/daemon/upload*.ts and src/daemon/resumable-upload*.ts. Compare the lease lifecycle with src/daemon/lease-registry-scope.ts and src/daemon/resumable-upload.ts; done means an upload exceeding the lease TTL can still reach a successful install RPC.

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

描述

Observed

agent-device install <449 MB .apk> --remote-config <profile> against a remote daemon (EAS Simulator Android session), with a profile that sets no leaseProvider, fails with UNAUTHORIZED: Lease is not active. Diagnostics show: lease_allocate with the default 60 s TTL, then a 1m47s artifact upload with no lease heartbeat, then the install RPC against the expired lease. A 30 MB iOS .app on the same path never hits it.

Cause (as read at efce352)

  • The CLI heartbeats or allocates the lease once when the command starts (src/cli/commands/connection-runtime.ts, allocateOrReuseLease). Nothing in the upload path (prepareRemoteRequestArtifacts / uploadArtifact, src/daemon/upload*.ts, src/daemon/resumable-upload*.ts) touches the lease.
  • The default connection policy sends no ttlMs, so the daemon applies DEFAULT_LEASE_TTL_MS = 60_000 (src/daemon/lease-registry-scope.ts). Profiles with leaseProvider: "proxy" get 5 minutes (PROXY_REMOTE_LEASE_TTL_MS), which hides the problem for uploads up to about 5 minutes (about 1.2 GB at 4 MB/s) but does not remove it.
  • #2517 keeps the lease alive for admitted work, but the install is admitted only after the upload finishes, when the lease may already have expired.
  • A client retry cannot recover: the upload preflight never reports a cache hit (src/daemon/resumable-upload.ts), so a retry uploads again under a new lease and fails the same way.

Expected

An install whose upload takes longer than the lease TTL still succeeds. Possible fixes:

  • heartbeat the lease while the upload is in progress,
  • have the daemon treat an in-progress upload for a lease as activity on that lease, or
  • allocate or renew the lease after the upload finishes and before the install RPC.

Repro

A remote daemon with default lease settings and a profile without leaseProvider; agent-device install of an artifact that takes more than 60 s to upload (for example a 400+ MB debug APK on a ~4 MB/s uplink). With a proxy profile, an upload longer than 5 minutes.

Downstream: appandflow/stim#924. Stim is moving its generated remote profile to the proxy lease policy in appandflow/stim#1029 as a workaround.

主要语言
TypeScript
星标
4.7k
派生
304
平均合并
11 小时 29 分钟
30 天内合并 PR
514

贡献指南

打开贡献指南

从这里开始

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

callstack/agent-device 的其他 Issue

查看 callstack/agent-device 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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