Repository navigation
Commit 84abb66
committed
fix(remote): renew the lease while an artifact upload runs on the caller's side
A remote install uploaded the artifact from the caller before the install request was admitted, so
nothing renewed the lease while the bytes moved: the daemon protects a lease while admitted work runs
on it (#2509, ADR 0007), and an upload is the mirror image of that. A 449 MB APK that took 1m47s to
upload against the one-minute default TTL expired the lease paying for the device it was uploading to,
and the install then failed `Lease is not active` (#2946).
`sendToDaemon` now brackets the upload phase with beats over the same transport the command uses. A
beat names the command's lease scope, its own request id, and nothing else: the scope is what the
daemon needs, and reusing the install request would send the upload's own payload once per beat. Each
beat gets a fresh id because a beat that times out is canceled under its own.
Only a remote daemon uploads and only a remote daemon holds a billed device, so a local command and a
command that names no lease get no timer at all, and the interval starts rather than fires
immediately, so an install that beats never sends no extra request. A beat that finds the lease gone
ends the upload with that lease error rather than finishing bytes to a device nobody owns; a beat that
fails for any other reason is reported through diagnostics and survived, since a later beat covers one
lost request.
ADR 0007 gains the rule this closes: what protects work that happens before admission.1 parent 004767e commit 84abb66
3 files changed
Lines changed: 744 additions & 1 deletion
File tree
- docs/adr
- src/daemon-client
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
70 | 88 | | |
71 | 89 | | |
72 | 90 | | |
| |||
0 commit comments