Repository navigation
Conversation
…ig file Operators can set `android.emulator.grpc` to start this machine's emulators with their gRPC endpoint on (`-grpc <console port + 3000> -grpc-use-token`). The emulator then writes its discovery file (`avd/running/pid_<pid>.ini`, with `grpc.port` and `grpc.token`), which tools that show and drive an emulator through gRPC, such as Android Studio's device manager and argent, read to find it. Off by default, so launches are unchanged. The port follows the console port, which the driver already reserves free and unique (even, 5586-5682), so two emulators never share one. Like the other `android.emulator` keys it is config-only and applies at a device's next boot; it does not enter the clean-baseline hash, because it changes no graphics state. The key joins the config contract, so the daemon protocol moves to 65.
… the baseline The tests that pin the protocol version and the config.get round trip, and the contract and daemon manuals, still named 64 or the four-key `android.emulator` block. A grpc row joins the baseline test, so the claim that the setting keeps the clean baseline is checked rather than stated. The gRPC port is as unique as the console port it follows, and no more: the allocator probes the console port and the one above it, not +3000. The configuration reference now says that with the setting on, Android Studio lists Simlock's emulators, which ADR 0001 otherwise keeps out of its sight.
# Conflicts: # src/contract/AGENTS.md # src/contract/protocol.ts # src/daemon-protocol/index.test.ts # src/daemon/AGENTS.md
…en gRPC endpoint at console port + 3000
…console port + 3000 Without -grpc, an emulator launched with -port serves no gRPC and writes no avd/running/pid_<pid>.ini, so tools that drive emulators over gRPC (argent, Android Studio's Running Devices) cannot find a leased one (callstackincubator#639). Every launch now passes -grpc <console port + 3000> -grpc-use-token, and the console-port allocator also probes the +3000 port. The gRPC flags stay out of the clean-baseline hash. This replaces the opt-in android.emulator.grpc key: the config key, its docs and the protocol 65 bump are gone, per the maintainer decision on callstackincubator#639.
…nd the clean baseline loads with it The callstackincubator#639 decision asks the slow lane to confirm both on a real emulator. The leased emulator's gRPC port, its console port plus 3000, accepts on 127.0.0.1 and refuses on every other IPv4 address of the host. After a release and a shutdown, the next lease boots from the clean baseline: the kernel boot id is the one the snapshot captured.
A connect that fails for any reason passed the old check, and IPv6 addresses on tunnels time out rather than refuse. lsof lists every listener on the port, on either family, so the test now asserts there is one and that none is bound beyond 127.0.0.1 or ::1. The title says "listens", which is what the test proves.
…napshot boot A matching boot id also passed if the emulator never stopped. The test now waits for the gRPC port to close after the shutdown, and an lsof failure other than "nothing listens" is thrown, not read as a closed port.
…ue that added them
|
Thanks for the decision on #639, and for the repro test. It made the fix straightforward. One question on the slow-lane check "an existing snapshot still loads with The upgrade case from the triage's Risk is a baseline captured without Is the lane test enough, or would you like the lane to cover the no- |
|
Already done! 👌 |
An emulator started with
-portand no-grpcserves no gRPC and writes noavd/running/pid_<pid>.ini. Tools that drive emulators over gRPC read that file, so they cannot find a leased emulator. Argent fails with "emulator not found among running emulators", while adb-only tools still work.As decided on #639, every launch now passes
-grpc <console port + 3000> -grpc-use-token. The allocator also probes the +3000 port, as it does the console and adb ports. The flags stay out of the clean-baseline hash, so existing baselines are kept.This replaces the earlier
android.emulator.grpcswitch: the config key, its docs and the protocol bump are gone. With the discovery file written, Android Studio's Running Devices may also list Simlock's emulators (not checked), which ADR 0001 keeps out of its sight. I can record that in an ADR if you want one.This implements the decision on #639, so a maintainer can close it. #1042 is a duplicate of #639.
bug/639-repro(5586 and 5588 give 8586 and 8588, each with a token), plus a console port skipped when its +3000 port is taken (src/drivers/android/index.test.ts)127.0.0.1:8590, and the LAN address refused a connection (emulator 37.2.12, API 37)-grpcloaded with it (by hand): a 2.3 s boot fromsimlock_clean_baseline, then asnapshotreclaim with no wipee2e/slow-android-smoke.test.ts, "a leased emulator's gRPC port, its console port plus 3000, listens on loopback only, ..."). lsof finds a listener on the port and none beyond 127.0.0.1 or ::1. After a release, the port closes, and the next boot keeps the kernel boot id the clean baseline captured. It passed in 37 s. It fails without the gRPC flags (nothing listens) and with snapshot loading forced off (the boot id changes). The lane's baseline is saved under-grpc; a baseline saved without it was checked by hand (the line above)Review
Spec review: skipped. Code review: 0 blocking, 4 fixed, 6 notes. Claims review: skipped.
Rounds: 3. Tokens: n/a.
Summary by CodeRabbit