The warm pool's seed make is cancelled by a daemon stop
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Part of #1964.
Scope
simlock daemon stop cancels an Android seed the warm pool is making, stops its emulator, removes what it left and ends, instead of waiting minutes for the make. If this goes wrong, a lease request that waits on the same seed is cut off, or an emulator of a half-made seed runs on after the stop.
Technical spec
Commit fd7a19c5a3e28007e0371e520e2448ce984d58bb.
Rows
- Behaviours: B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11
- Stored state: S1
- Interfaces: I1, I2, I3, I4, I7, I5, I6
- Existing code: X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18, X19, X20
Facts
| # | Fact | Source |
|---|---|---|
| F1 | #makeSeed's catch removes folder and row and rethrows; a failed removal is logged and keeps the row |
src/drivers/android/seeds.ts:898, src/drivers/android/seeds.ts:924 |
| F2 | #killAndAwait kills with SIGKILL and waits for the exit |
src/drivers/android/seeds.ts:939 |
| F3 | a withLock caller waits for every earlier one of its key, so a caller is counted from before the call |
src/drivers/android/device-table.ts:84 |
| F4 | drain() is called by the worker's stop only, and by tests |
src/core/create-core.ts:520, src/daemon/worker-composition.ts:617 |
| F5 | the scripted runner's run and spawn record options and read no signal |
src/ports/scripted-process-runner.ts:77 |
| F6 | the pool's test harness fakes the provisioner | src/core/warm-pool/test-fixtures.ts:352 |
Modules touched
Searches: rg 'stopPlanning|settleAcquisitions|releasePlanResources', rg 'provision\(', rg 'WarmPool|warmPool\.drain', rg 'emulator\.(start|shutdown)', rg 'runOrThrow\(', rg 'ScriptedProcessHandle' in src/.
flowchart LR
daemon[src/daemon stop] --> leasing[src/leasing planning]
daemon --> pool[src/core/warm-pool]
pool --> prov[src/core/device-provisioner]
prov --> driver[src/core/driver]
driver --> android[src/drivers/android seeds, emulator, adb-tools]
android --> ports[src/ports scripted runner]
src/core/driver.ts,src/core/device-provisioner.ts,src/core/fake-driver.tssrc/core/warm-pool/converger.ts,src/core/warm-pool/test-fixtures.ts,src/core/warm-pool/AGENTS.mdsrc/drivers/android/index.ts,src/drivers/android/seeds.ts,src/drivers/android/emulator.ts,src/drivers/android/adb-tools.tssrc/drivers/ios/index.ts(option type only)src/leasing/acquisition-gates.ts,src/leasing/acquisition-workflow.ts,src/leasing/lease-acquisition-coordinator.ts,src/leasing/create-leasing.ts,src/leasing/AGENTS.md,src/daemon/worker-composition.tssrc/leasing/test-lease-model.ts(its stop keeps the worker's order:stopCreations()before the drain)src/ports/scripted-process-runner.tsdocs/internal/flows/startup.md(Stop, step 5),website/src/content/docs/docs/worker/daemon.mdx(the stop section)e2e/slow-warm-pool.test.ts(one new case)
Rules in play
docs/internal/agent-rules/architecture.md2 and 3: the signal is a driver option every driver may ignore; core names no platform.docs/internal/agent-rules/architecture.md11 and 12: every wait an abort leaves is bounded as today; a cancelled make ends with no row, or with amakingrow the sweep clears.docs/internal/agent-rules/safety.md1: only the make's own emulator handle and folder are touched.docs/internal/agent-rules/testing.md3, 6 and 7: each row is tested once, through its seam.- ADR 0061 §1: the
makingrow precedes the folder and is removed after it, as today. - ADR 0041 §4: the 300 s limits stay.
src/core/warm-pool/AGENTS.md,src/leasing/AGENTS.mdanddocs/internal/flows/startup.md: X19 says what changes.
Tests
Seams: startDaemon with a fake driver (src/daemon/main-stop.test.ts), the pool harness (src/core/warm-pool/converger-targets-passes.test.ts), createLeasing (src/leasing/create-leasing-warm-targets.test.ts) and AndroidDriver with scripted processes (src/drivers/android/seeds-copies.test.ts for its stages).
- B1: An operator stops the daemon while a warm target's creation is inside the driver's
provisionand the driver honours the signal: the stop ends without the creation finishing, no device record is written, the log holds the I4 line and nowarm pool creation of a device failed: stop bydaemon.stop() - B2: An operator stops the daemon while a learned kind that already failed twice is being created: the cancel is not a third failure, so the kind is still learned after it, and the pool harness sees no queue wake from the cancel (I3) (decided in delivery, pending the maintainer): —
- B3: A stop cancels a pool creation while a request waits in the queue for the slot it held: the stop starts no creation for that request and ends without one: Android limit 1, one target creation under way, one queued Android request: of another model; of the same model. The same with a second flight, an iOS creation that ignores the signal and ends after the cancel (its end wakes the queue). In each, the Android
provisionis called once and no lease is granted - B4: A stop comes when the pool's creation has not reached the driver: the provisioner is never called and the reservation is given back: the flight waits for its reservation's turn in the decision lock when the drain begins
- B5: A stop comes while a creation's driver ignores the signal, or while a registered device boots: the stop waits and the device ends ready; the pool starts nothing else: booting: proved by the existing test "on a graceful drain finishes the creation in flight"; driver ignores the signal: new
- B6: A caller aborts
AndroidDriver.provisionwhile it makes the seed: it rejects with the signal's reason, after the seed's emulator was killed and has exited, the folder and themakingrow are gone, and the console port is free; no adb, emulator or avdmanager command starts after it rejects: aborted during:avdmanager create; the first boot's wait for the device;sync; the wait for power-off; the second boot's wait; the snapshot save; the wait for the emulator's exit after the save. Each abort check I5 or I6 names that scripted processes can reach has a case that fails without it; a check neither names, and that no case can make fail, is removed (decided in delivery, pending the maintainer) - B7: As B6, when the folder cannot be removed: it still rejects with the signal's reason, the existing warning is logged and the
makingrow stays: removal throwsEBUSY - B8: A caller aborts while another call waits for the same seed: a call with no signal keeps the make running, its result is used, and the aborted call then rejects with the signal's reason and takes no copy: waiting
provisionwith no signal: make finishes; waitingensureSeed: make finishes; waitingprovisionwith the same aborted signal: make cancelled, both reject, one make only;provisionwith no signal that arrives after the abort: waits for the cleanup, then makes its own seed; a no-signal call that has already finished no longer keeps a later aborted call's make running (decided in delivery, pending the maintainer) - B9: A caller's signal is aborted before any make of its own runs:
provisionrejects with the signal's reason and makes and copies nothing: aborted before the call; aborted while it waits for the lock of a make another call runs (that make finishes) - B10: A caller aborts after the copy of the finished seed began: the copy ends and the device is returned: abort during the copy
- B11: During the drain a request in the queue is planned: it gets a ready device or boots a shut-down one as today, and it starts no creation and no eviction; the reservation or claim its plan took is given back: plan is a grant of a ready device; a boot of a shut-down one; a creation; an eviction of an idle device (nothing is shut down or deleted); a creation already under way when planning closes: it ends in a grant
Done when
pnpm test:changedandpnpm typecheckpass.- Slow lane, real emulator: a new Android case in
e2e/slow-warm-pool.test.ts, with no kept seeds and one Android target, runssimlock daemon stopwhile the seed's emulator boots: the command exits 0,daemon.loghas the I4 line, no emulator of this daemon runs,sources/holds no folder, and nothing listens on the daemon's adb port; a start after it ends with the target's device ready. Runscripts/slow-e2e.sh e2e/slow-warm-pool.test.ts. src/core/warm-pool/AGENTS.md,src/leasing/AGENTS.md,docs/internal/flows/startup.mdandwebsite/src/content/docs/docs/worker/daemon.mdxsay what X19 says.
Out of scope
- Everything under the feature's Non-goals.
- Passing a seed settle's signal to its port reservation or its shutdown (
#settleCopy): a settle stops as today (decided in delivery, pending the maintainer). - A run on a Windows PC: reported on #1700 after the merge, before #1700 closes.
Depends on
none
Written by an agent.
- Ngôn ngữ chính
- TypeScript
- Star
- 730
- Fork
- 44
- Merge trung bình
- 16 giờ 13 phút
- Pull request đã merge (30 ngày)
- 387
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của callstackincubator/simlock
-
The SIGKILL escalation test passes without escalation when its child starts later than 100 msĐang mởbug:new
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
callstackincubator/simlock#1986 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug:new
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
callstackincubator/simlock#1979 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
process-runner.test.ts fails four tests when a child starts 1 to 3 s lateCó thể đã có người làm @V3RON đã nhận hôm nay. Đang mởbug:new
callstackincubator/simlock#1985 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug:new
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
callstackincubator/simlock#1984 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
iOS runCommand passes timeoutMs to spawn, which ignores it, and its comment relies on that backstopĐang mởbug:new
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
callstackincubator/simlock#1980 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của callstackincubator/simlock
Issue tương tự
-
Resources: Update work of fuzhouCó thể đã có người làm @rmt-svc đã nhận hôm nay. Đang mởresources
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
railmapgen/rmp-gallery#4245 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
mike-north/AgentMonitors#717 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 60/100
slavakurilyak/awesome-ai-agents#1100 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
navikt/syfo-oppfolgingsplan-frontend#1206 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[typescript] BasicAuth.fromAuthorizationHeader accepts headers without the Basic scheme prefixĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày