Ben Carr
90d · built 2026-11-22
Performance
What Ben Carr shipped in the selected window, measured in ETV, and how it compares with the 90 days before it.
Effective capacity
+46.9engineers
delivers like 47.9 (47.9x pre-AI)
Output (ETV)
42.2ETV
+740.2% vs 5.0 prior
Features share
49.8%
+12.0 pp vs prior window
Fixes share
11.2%
+6.4 pp vs prior window
Work mix
49.8% Features19.3% Maintenance18.2% Tests1.5% Docs11.2% Fixes
157 commits over 90 days, ending 2026-11-22.
Daily performance
Daily ETV, stacked by Features, Maintenance, Tests, Docs and Fixes.
Repository spread
Where this developer's commits land. Concentrated work (top1 > 80%) vs polymath spread (top1 < 30%).
Most impactful commits
Top 10 by ETV in the last 90 days.
- 4.2ETVEvict tenants with coordinated disk ownership and daemon shutdown Summary: Make daemon shutdown aware of individual tenants. A tenant owns the build state for one `(project root, isolation directory)` pair. With `BUCK2_SHARE_DAEMON=true`, `buck2 kill` evicts that tenant and `buck2 killall --repo` evicts tenants for the current repository, optionally filtered by `--in-isolation-dir`. Without it, `kill`, `killall` and `clean` keep stopping daemon processes under the lifecycle lock as before. Eviction removes the selected tenants from the registry, cancels their commands and background materialization, and waits for cancellation and cleanup. A replacement generation cannot initialize or start actions until the old generation releases output and cache ownership. Initialization and eviction cleanup are daemon-owned, so a disconnected client cannot release ownership prematurely. The daemon continues serving its remaining tenants. Evicting the final tenant atomically marks the registry as draining, rejects new tenant creation, and starts shutdown. Prevent old and replacement tenant generations from writing to the same output and cache directories concurrently. Each tenant holds a lease backed by a semaphore and a persistent OS file lock. Queued I/O checks cancellation before executing. Running I/O, SQLite handles, command admission tasks and idle paging retain the lease until their work terminates. Stop the deferred materializer worker and cancel its tasks when its owner is dropped, retaining its I/O services until termination. Reject initialization that finishes after its generation was evicted. Status keeps metadata and weak tenant references so it does not retain evicted disk services. Use the same lease to coordinate `buck2 clean` with tenant recreation and hold ownership throughout deletion. Shared cleanup evicts and cancels the selected tenant while preserving siblings. Reserved lock paths prevent cleanup from unlinking sibling ownership locks, and legacy lifecycle coordination prevents shared tenants from claiming disk state still owned by an older daemon. A shared daemon keeps its working directory and forkserver state outside disposable tenant outputs; an unshared daemon keeps them in its tenant's buck-out. Give each forkserver a private UUID state directory with a filesystem lease inherited by the process. Reclaim abandoned directories after their process and clients release ownership, preserving live and unowned state; a failed reclamation is logged rather than blocking forkserver startup. Eviction connects only to existing daemons. Introduce `CancellationScope` in `buck2_common` to track the work a tenant spawns so eviction can cancel and await it. The scope sweeps finished entries only when its tracked list doubles, so a materializer spawn does not scan every in-flight task. Without `BUCK2_SHARE_DAEMON`, these behaviours change: - `kill_command_impl` stops the recorded daemon when a process accepts the connection to the recorded endpoint but the first request to it fails, and only if the recorded pid still has the start time recorded in `buckd.info`, so that cleanup can take disk ownership. Errors before a connection is accepted (a transport failure, an unparseable endpoint) still leave the recorded process alone, and a failed kill is a warning, as before. - The daemon holds its tenant's disk lock at `~/.buck/buckd/<root>/._buck2_tenant_locks/<isolation>` for its lifetime. `buck2 clean` waits up to 30 seconds for it after stopping the daemon, and deletes nothing if it cannot take it. - A client starting a new daemon waits for that lock under the lifecycle lock, within its startup deadline, so a previous daemon still releasing its outputs finishes first. A running `buck2 clean` holds the lifecycle lock, so a concurrent command waits for it there, as before. A timeout names both possible owners and is tagged `BUCKD_LIFECYCLE_LOCK`. - Each forkserver gets its own state directory with a lease under `buck-out/<isolation>/forkserver`, and abandoned siblings are reclaimed. - Every deferred-materializer task, including cleanup that used to be queued inline, is spawned through the materializer's own `CancellationScope` with a real cancellation context. Dropping the materializer cancels that scope and stops its worker, which in an unshared daemon happens only at shutdown; eviction reaches it because the tenant's scope waits for the disk lease the materializer holds. A task that panics keeps its `TOKIO` classification; one cancelled at eviction or shutdown is tagged `INTERRUPTED_BY_DAEMON_SHUTDOWN`. - If the recorded daemon cannot be killed (for example `EPERM`) and still holds the tenant lock, startup waits out its deadline and fails, instead of starting a second daemon over the same outputs. - `--no-buckd` takes the tenant lock in its in-process daemon with the daemon's own 10-second wait, after the client has released the lifecycle lock. - The lock files `._buck2_tenant_locks/<isolation>` and `buck-out/<isolation>/forkserver/.lifecycle` persist after the daemon exits. - The help text of `kill`, `clean` and `killall`, and `buck2 help-env`, describe `BUCK2_SHARE_DAEMON`. Existing daemon E2Es are unchanged in default mode. A new test checks that a daemon whose recorded endpoint is unreachable is replaced; a new test checks that unshared forkserver state is reclaimed under `buck-out/<isolation>`; and a new test holds the tenant lock past the old fixed wait to check that daemon startup waits for it rather than failing. Reviewed By: JakobDegen Differential Revision: D123711955 fbshipit-source-id: 0ea876470e8b4c76b40959db91ad5cb7484f6493github.com-facebook-buck2 · ccd85336 · 2026-11-01
- 2.2ETVScope soft-error policy to each command Summary: Parse `BUCK2_HARD_ERROR` and `BUCK2_SHOW_SOFT_ERRORS` into immutable per-command soft-error contexts carried by `EventDispatcher`. Move emission quotas into the same context so concurrent commands cannot reset or consume one another’s allowance. Keep a process-lifetime fallback for work without a command dispatcher. Preserve command context across task, thread, version-control, page-out, completion, heartbeat, blocking-I/O, deferred-materializer, persisted dep-file, worker, debugger, test-orchestrator, and detailed-metrics boundaries. When a command-scoped soft error reaches a worker without an ambient dispatcher, route it only to the active command that owns the context instead of broadcasting it to unrelated clients. If the owning command has already exited, the event is still written to Scribe but is deliberately not injected into another command’s event stream. Reviewed By: scottcao Differential Revision: D120195703 fbshipit-source-id: 720554d1178e50516630368b25f02993791b7246github.com-facebook-buck2 · 3e5a8d0b · 2026-09-16
- 2.1ETVSelect shared DICE engines at daemon startup Summary: Add `[buck2] share_dice` as a daemon startup setting, defaulting to separate engines per tenant. Shared mode creates one engine and attaches roots with repository-specific `DiceData`. Both modes use the same tenant routing and command lifecycle. Use Jakob's tracked filesystem baselines (D123170024/D123170025) for checkout correctness and reuse. Roots retain ordinary initial epochs, so matching tracked inputs can reuse computation results across tenants. Reject incompatible engine facilities, digest configurations, and Buck settings. Track the absolute tenant isolation directory through an injected `IsolationDirKey` dependency of `ArtifactFsKey`. Shared paging uses daemon-owned storage. Tag command events with `dice-sharing` for A/B analysis. Give tenant coordinators ownership of their roots. Eviction cancels tenant work and stops coordinator admission; roots retire after cancelled commands and computations terminate. Discarded-root cleanup retains disk ownership even after the current coordinator stops, preventing replacement actions from reusing outputs prematurely. Initialization failures release their roots. Fresh-instance resets preserve tenant data and rely on the watcher's baseline for invalidation. Root replacement cleanup remains cancellation-safe. Add a regression for both runtime modes with separate filesystem roots: equal revision baselines reuse the file computation only in shared mode; differing baselines and recorded local changes produce the correct values; artifact filesystems retain the correct project root. D125049795 is unnecessary after removing root epoch isolation and has been dropped. Adopt Jakob's cycle detector stack ending at D123330665. Both runtime modes enable cycle detection unconditionally, as required by D123330660. Remove obsolete cycle compatibility inputs, the test for incompatible cycle settings, and cycle-only tags and handles. Keep paging, digest, and Buck-settings compatibility checks. Inject the absolute `buck-out/<isolation>` path as `IsolationDirKey`, alongside the existing `BuildDataKey` for the project-relative buck-out resolver. `ArtifactFsKey` and the project-root accessor depend on this directory, so cached parents invalidate across isolation directories and checkouts. The project-root accessor reads the current root's `IoProvider` after recording the isolation dependency. Inject the directory during command setup with the buck-out path. In an unshared daemon the injected value never changes, so the new dependency invalidates nothing. BXL, query, and external-cell path consumers retain that dependency. Path-independent file computations still reuse matching baselines. Add `cached_artifact_paths_follow_tenant_roots`: a cached parent resolves an absolute output path under equal file baselines. Cover different isolation directories in one checkout, another checkout with the same isolation name, and repeated returns to earlier tenants in both runtime modes. A cached parent that depends only on `IsolationDirKey` checks the directory directly and verifies shared-mode reuse when the absolute isolation path matches. Place shared paging storage under `buck-out/._buck2/dice_state/<daemon UUID>`, outside disposable tenant output/cache trees. Bind kernel ownership to the pagable storage backend context so an engine surviving its provider retains storage. Serialize creation/reclamation with a persistent parent lifecycle lock; reclaim only an existing unlocked ownership file, preserving active and unknown directories. Drop reclaims released storage when destructors run; later initialization reclaims stores left by process exit. Respect environment-overridden external storage paths. Separate mode retains tenant-local paging paths. Preserve master's page-out and eviction policies when constructing shared and separate engines. Start memory-pressure eviction once per engine, using a weak engine reference so the listener survives recreation of the first tenant. A regression checks one pressure subscription for a shared engine and one per separate engine. Reviewed By: JakobDegen Differential Revision: D125031308 fbshipit-source-id: 24e104f5475f29f19d6fe6ebc72567c69345438bgithub.com-facebook-buck2 · 2f8bc6e9 · 2026-11-01
- 1.5ETVSelect daemon sharing with `[buck2] share_daemon` through the versioned namespace Summary: Daemon sharing was enabled with `BUCK2_SHARE_DAEMON`, `BUCK2_DAEMON_GROUP` and `BUCK2_UNIDAEMON`, which were debugging switches. A user-facing A/B test needs a knob that rolls out host by host and that every client of a checkout agrees on before it picks a daemon, so routing now comes from the root buckconfig the way other startup settings do. - `[buck2] share_daemon` is a `RolloutPercentage`: `true` or `hostname:<fraction>` enables sharing; the per-process random form is rejected, since all clients on a host must select the same daemon. Hosts that cannot run a shared daemon (today anything but Linux, or a non-deferred materializer) resolve to unshared whatever the share says, as does `--no-buckd`. - `DaemonRouting` holds the choice. It is a `DaemonStartupOptions` field, so a daemon serves only tenants routed the same way and `DaemonCompatibilityKey` covers it; the daemon applies the routing it was started with. The `daemon_routing` command metadata reports it; its values are now only `unshared` and `shared` (`group` and `unidaemon` are gone). - `InvocationPaths` resolves routing only for commands that may contact, start or manage a daemon. The daemon, forkserver and internal test-runner processes, `log`, `root` (except `--kind daemon`), `init`, `help-env`, `completion`, and the `debug` subcommands `persist-event-logs`, `upload-re-logs`, `exe`, `internal-version`, `chrome-trace` and `log-perf` skip the root buckconfig parse; anything that needs routing in such a command fails with an internal error rather than guessing. - `killall --repo` evicts every tenant it can and reports the ones it could not, instead of stopping at the first failure as the prototype path did; a tenant directory whose `buckd.pid` names a live process but has no `buckd.info` counts as a failure, while a pid left by a daemon that died starting is ignored. From a checkout routed unshared, `killall --repo` leaves alone processes running in the checkout's shared-daemon state directory (`buck-out/._buck2`): a shared daemon started from this checkout before it opted out serves other checkouts too. - `buck2 root --kind daemon` resolves the routing, so under sharing, once the tenant has registered, it prints the shared daemon's directory. Remove the experimental routing modes that came with the sharing stack: the project-wide `._buck2_shared` daemon directory, named groups under `.groups/<name>`, the shared-directory metadata repair in `connect`, `kill`, `clean` and `killall --repo`, the constraint-mismatch error, and the tenant disk lock's wait on a legacy daemon, which the proxy handoff replaces. Neither mode scoped its daemon by release. These modes landed with the accepted stack on 2026-11-01 and have not been in a release; this commit must land before the next release cut so they never ship. A daemon a master build started with `BUCK2_SHARE_DAEMON=true` keeps its tenant locks until it exits or `buck2 killall` stops it. Tests of the removed behaviour are deleted; tests of tenant mechanics (eviction, disk ownership, sibling survival, repository eviction, telemetry, DICE ownership, paging) run against the remaining mode. Default mode (`share_daemon` unset): routing is unshared, and every path, lock and kill path is the one all releases use; no namespace, proxy or reference file is created. One behaviour is new: every command except the skip list above reads the root buckconfig at startup to learn the routing. Commands that start a daemon already read it; for existing-only commands such as `kill`, `clean`, `killall`, `status` and the daemon-facing `debug` subcommands, the read is new. If it cannot be read they fall back to unshared and keep working; commands that need a daemon report the error when they build their startup config, as before. Across releases a client of another release never connects to a shared daemon of this one: it kills the tenant through its proxy, and the namespace it looks in is keyed by its own compatibility key. Within a release the new startup field has a serde default, and the version check already restarts a daemon of another release. The E2E harness pins `share_daemon = false` in each test's external config and gives a private home directory to clients that opt into sharing (`daemon_routing_env(share_daemon=True)`), since a shared daemon's namespace is keyed only by the compatibility key. `buck2.py` no longer needs to disable sharing; the help goldens drop the three environment variables. `docs/concepts/daemon.md` now records why a failed eviction ends the whole shared daemon: released clients start a daemon of their own over the tenant's outputs within seconds of asking the slot's owner to stop, so the daemon must have released them by then or not be running. Reviewed By: JakobDegen Differential Revision: D128397011 fbshipit-source-id: 2e0c59ed7695f4c4282d2a19d43be815a1792917github.com-facebook-buck2 · be5dadd3 · 2026-11-11
- 1.5ETVRoute sharing clients through tenant proxies Summary: Clients with daemon sharing enabled register their tenant with the shared daemon and reach it through the tenant's proxy afterwards. As a daemon of any release writes its own `buckd.info` and `buckd.pid`, the proxy writes the tenant directory's files; the client writes none of them, and the proxy is the tenant's only record. A client finds its tenant the way a released client finds a daemon: it connects to whatever owns the tenant's own daemon directory and asks its `Status`. A proxy reports the shared daemon's constraints, from which the client derives the namespace key as the daemon does, the daemon id, and the tenant's generation; a daemon of the tenant's own reports no generation. - Clients send the tenant generation they registered in `ClientContext`, and the daemon refuses a command for any other generation, so a command started before an eviction cannot run against its replacement. - `kill` and `clean` stop whatever owns the tenant's directory, as a released client does, holding the slot lifecycle lock across the transition; for a proxy that is an eviction of exactly its generation. `killall --repo` evicts the repository's shared tenants. - Commands that need the daemon directory before connecting (`root --kind daemon`, `debug daemon-dir`, `debug thread-dump`, `rage`) resolve the tenant's namespace the same way. - The lifecycle lock for a namespace directory lives outside it, so `clean_daemon_dir` cannot remove it. - `docs/concepts/daemon.md` describes the proxy, its fallback and the event log. - E2E coverage for the proxy lifecycle and recovery. The test target supplies a released buck2 (`fbsource//tools/buck2-versions:stable`) as `BUCK2_TEST_LEGACY_BINARY`, so the cross-release cases run against a real release. Also, all under sharing: - The compatibility key requires the deferred materializer, judged by `DaemonStartupOptions::runs_disk_state_materializer`. The client decides this before any daemon runs, so the disk-state materializer's rollout constant moves into `buck2_common`, where the client and the daemon read one predicate. The moved constant keeps the value master has at the time of landing (3 after the Nov 2026 bump), so the move rolls nothing back. - A command that may start a daemon takes the tenant directory's lifecycle lock while it probes the directory's owner and holds it until the daemon it may have started is up: until the tenant's proxy owns the directory, a client of any release that finds it vacant would start a daemon of its own over the tenant's outputs. It releases the lock before registering, since registration publishes the proxy, which takes the lock itself, and then waits for the tenant to initialize. - An owner that is not the proxy of a live daemon of the client's own key (a proxy of another namespace, a proxy of a daemon that is gone, or a daemon of the tenant's own) is killed as any client kills a directory's owner, which moves the tenant to the daemon of the client's key. - A client with no trace-I/O preference, which a daemon of the tenant's own would serve either way, settles on the trace state of the live daemon its proxy reports, so that it hashes to that daemon's namespace, and otherwise on no tracing. - After registering, the client removes the namespace directories of daemons that have exited, leaving in place any it cannot judge or remove. This housekeeping lives in `daemon::client::namespaces`. Default mode: without sharing (at this commit `BUCK2_UNIDAEMON=true`), `kill`, `clean` and `killall` take their existing paths, no proxy is launched, and the generation is never sent. Reviewed By: JakobDegen Differential Revision: D128976646 fbshipit-source-id: 1051b72283a93fcf25ce92aee48df31f5f4d92c2github.com-facebook-buck2 · 3eb9805a · 2026-11-11
- 1.2ETVServe registered tenants through tenant proxies Summary: The shared daemon now launches a tenant proxy for each generation it registers, supervises it, and retires it when the generation is evicted. With this the three commits below become the daemon side of daemon sharing; the next commit connects clients to the proxies. At this commit the opt-in is `BUCK2_UNIDAEMON=true`; `[buck2] share_daemon` replaces it later in the stack. - Launching, retiring tenant proxies and the emergency shutdown are hooks (`LAUNCH_PROXY`, `RETIRE_PROXY`, `EMERGENCY_SHUTDOWN`) that the daemon binary installs only when sharing is enabled (`startup_options.unidaemon`), on Linux. With the launcher installed, a registration under sharing fails rather than serving a tenant without a proxy. - Clients of one tenant may register concurrently and share a generation; a second launch for the same generation waits until the first has published its proxy instead of failing it, which would evict the generation the first client is still starting. A spawned proxy can still fail its handshake or refuse the slot, so a live pid is not enough. A launch that fails, and a proxy that is lost, leave their registry entry behind marked lost, so a registration of that retired generation fails rather than launching a proxy for it; generations are never reused. The launcher waits fifteen seconds for the proxy to identify itself and publish. - The proxy spec, which carries the shared daemon's credentials, is written to a temporary name and renamed into place, so a reader never sees a partial file; a failed write removes the temporary file, and a launch that fails removes the spec it wrote. - On liveness loss the supervisor begins the generation's eviction. After a crash or a broken link, it recovers a fresh generation and proxy once cleanup is done and the slot, checked under the slot lifecycle lock, still names the lost proxy; a client holding that lock at the moment of the loss rules recovery out, and the next command registers the tenant again. A proxy stopped with `SIGKILL` or `SIGTERM`, as `buck2 killall` does, stays stopped: its tenant retires, its connection files are removed when the slot lock is free, and otherwise left for the next client, which treats a record naming a dead process as a vacant slot, and the next command registers the tenant again. Recovery is limited to three times per tenant per minute, so a proxy that keeps failing retires its tenant instead of making the daemon re-initialize it indefinitely. Replacement after a crash registers through the same path, publishing the new proxy before the new generation initializes. - When a generation's eviction completes, the daemon tells its proxy to exit over the liveness socket and waits for the proxy's exit, which closes its end of the socket, for up to three seconds: a released client hard-kills the proxy four seconds after sending Kill, so a longer wait would only delay the eviction's completion. A client that asked for the eviction waits for that instead of stopping the proxy itself. A proxy whose liveness is already lost cannot hear it and is not waited for: its supervisor stops it once the eviction completes, and waiting would spend the kill's budget on it and let the watchdogs stop the daemon. - Proxy lifecycle events are appended to `unidaemon-events.jsonl` beside the tenant's daemon directory. - `buck2 daemon --unidaemon-reap` is a hidden helper the emergency exit uses to kill its parent daemon's tree from outside it. Blast radius: the watchdog stops the entire shared daemon, so a tenant whose eviction overruns its deadline ends every other tenant's builds in that daemon. That is the intended fallback for coexisting with released clients, which start a daemon of their own over a tenant's outputs four seconds after asking, or at once when the tenant's directory names a dead owner: by then the shared daemon must have released those outputs or not be running. Default mode: nothing here runs without sharing enabled; the daemon binary installs the proxy launcher and emergency shutdown only when its startup config enables sharing, on Linux. Reviewed By: JakobDegen Differential Revision: D128976645 fbshipit-source-id: f79d1462125aac2a670acbcba63f54c7e8f4c36dgithub.com-facebook-buck2 · edd69209 · 2026-11-11
- 1.2ETVCoordinate concurrency admission through an actor Summary: Move repository-local admission state into a Tokio coordinator task while preserving the `ConcurrencyHandler::enter` facade and existing policy. The coordinator owns complete pending commands, active commands, DICE status, cleanup epochs, and blocked waiters. Encode pending and active ownership as distinct, non-cloneable handles so admission atomically consumes pending ownership into active ownership and lifecycle responsibilities cannot be duplicated. Command tasks retain the update permit, updater, `DiceTransaction`, observer, telemetry, and command execution so the coordinator never awaits external work. Replace the condition variable and separate queued registry with targeted wake channels and a cancellation-safe command lease. Normal completion waits for release acknowledgement; cancellation uses the lease drop path. Prepare cleanup in the coordinator before the triggering transaction can be dropped. If an after-update reply is dropped, restore any preemption senders borrowed from active commands before releasing the arriving command, so cancellation cannot silently disable later preemption. The actor lifetime is channel-owned: dropping the final handle closes blocked wake channels and lets the coordinator task terminate without retaining itself. Reviewed By: JakobDegen Differential Revision: D120751935 fbshipit-source-id: 5db7ed2f2af4c1c7afb805ccb9a0a923df65c348github.com-facebook-buck2 · c9d21d97 · 2026-09-29
- 1.1ETVAdd the tenant proxy process of a shared daemon Summary: Each shared tenant keeps a small authenticated proxy in its usual daemon directory. The proxy writes the files a daemon of any release writes there (`buckd.info`, `buckd.pid`), answers `Status` (with its own pid, the shared daemon's constraints and the tenant's generation), `Kill`, `EvictTenant` and `EvictProjectTenants` for the shared daemon, returns UNIMPLEMENTED for any other request, and exits within the legacy four-second kill grace, so a client of another release kills a tenant the way it kills a daemon. The proxy is the only record of the tenant: a client of this release learns which namespace, daemon and generation serve its tenant by connecting to the directory's owner as any client does, from the constraints and generation the proxy reports. This commit adds the process; nothing launches it yet. The next commit launches, supervises and retires proxies from the shared daemon. - The proxy lives in its own crate, `buck2_tenant_proxy`, between `buck2_server` and `buck2_daemon`; the daemon binary runs as a proxy when started with `--tenant-proxy-file`. The crate is Linux-only in Buck and the daemon depends on it only on Linux, the way it depends on `buck2_forkserver`; Cargo still builds it everywhere, with its crate root gated to Linux as `buck2_forkserver`'s is to Unix. - The proxy is attached to the daemon through an inherited Unix monitoring socket; it verifies the daemon UUID, compatibility key and tenant generation before publishing its connection files, and exits when the daemon tells it its generation is retired or when it sees the daemon gone, removing its connection files on the way out. - `Kill` is forwarded as an eviction of the proxy's generation with a budget of three seconds: a released client hard-kills the proxy four seconds after sending Kill, less a second for the forced tree kill. If forwarding fails or the eviction overruns, the proxy stops the shared daemon's process tree itself within 400 milliseconds, so that it finishes before the client's hard kill, and records whether the exit was confirmed. - The proxy publishes under the tenant directory's `buckd.lifecycle` lock, which clients of every release hold when they replace the directory's owner, and refuses a directory whose `buckd.info` names a live process other than itself, so a registration racing a released client never finds a half-written slot or overwrites that client's daemon record. Until it owns the directory it only appends to the logs there. It waits for the lock up to ten seconds, which covers a client holding it across a legacy kill, and a record that cannot be parsed falls back to `buckd.pid`. - Test gates `BUCK2_TEST_PROXY_BEFORE_EVICT` and `BUCK2_TEST_PROXY_CLOSE_LIVENESS`, which the tests in the commits above drive. Default mode: nothing here runs without sharing enabled; the daemon binary runs as a proxy only when started as one. Reviewed By: JakobDegen Differential Revision: D130030728 fbshipit-source-id: d9442c7627959a005844a37ebebdce754ded065agithub.com-facebook-buck2 · 9577e141 · 2026-11-11
- 1.0ETVRoute opt-in unidaemon tenants by startup compatibility Summary: Enable compatibility-based discovery for daemon sharing. At this commit the opt-in is `BUCK2_UNIDAEMON=true` alongside `BUCK2_SHARE_DAEMON=true`; `[buck2] share_daemon` replaces both later in the stack. Keep the default daemon routes and explicit debugging groups available. The daemon derives the same key from its own version, user version, startup configuration and trace-I/O mode, so nothing about the namespace crosses from the client to the daemon. Add `Unstable_RegisterTenant` to initialize the addressed tenant and return its registered generation; the generation is unused until tenant proxies carry it. Every command addresses the namespace of the client's own constraints and nothing else: `ClientCommandContext::paths` selects it before any connection, and a command that may start a daemon reselects with its requested trace-I/O state. A client whose trace-I/O preference is `Existing` hashes as not tracing, so it lands in the non-tracing namespace even when a tracing daemon serves the tenant; resolving that preference against what is running arrives with discovery metadata in a later diff. Likewise `kill` and `clean` reach only the daemon of the client's own key, so a tenant served by a daemon of another key is out of their reach, as it is out of a legacy client's, until the tenant proxies of a later diff represent it in its own daemon directory. Add integration cases for matching cross-checkout namespaces, incompatible startup settings selecting another process, sibling preservation, and eviction/recreation in both DICE modes. Clear inherited sharing flags in the E2E harness and update environment-help goldens and daemon documentation. This slice uses the existing shared-tenant disk ownership protocol. Legacy proxy interoperability, conditional generation eviction, watchdogs, supervision, and automatic tenant migration arrive in the commits above. Known gap: with `share_dice`, tenants of one DICE engine must agree on everything the engine reads from the root that initialized it, the ignore set among them; nothing in the key tells two checkouts with different `[project] ignore` apart yet. The startup settings that are migrating out of buckconfig will be hashed into the key as a unit and close this. Reviewed By: JakobDegen Differential Revision: D128396988 fbshipit-source-id: 3ef4bf87c92e88010e3b39cc7088aab1e78e10f6github.com-facebook-buck2 · e14f472c · 2026-11-11
- 0.8ETVReserve a tenant's generation before initializing it Summary: `Unstable_RegisterTenant` (added by the routing commit) now reserves the tenant's generation, launches its tenant proxy through a hook, and only then initializes the tenant, so a `kill` that arrives during initialization finds the proxy and evicts the generation through it. Nothing installs the launcher yet: until the proxy commits above do, a tenant is served without a proxy, as before. - A registration that does not run to completion, because its launch or initialization failed or the daemon dropped the request, evicts its generation when nothing else holds it: a generation that other clients are still registering, or that has already initialized, stays, and one that never initialized and has no registrant left is evicted, so that it does not stay registered without a client or a tenant; a proxy that published after its generation was already evicted is retired as well. No watchdog bounds that eviction, since no client waits for it; it completes once the tenant's initialization, which cannot be interrupted, has returned. A registration of a tenant whose earlier generation is still being evicted, by any request including `killall --repo`, waits for that eviction to complete before it launches its proxy, since the earlier generation's proxy owns the tenant's directory until then. - The proxy's spec (`TenantProxySpec`) is built from what is known before the tenant initializes: the daemon's identity, constraints, compatibility key and trace-I/O choice, which every tenant's I/O provider is built from. The I/O provider and the materializer state identity come out of initialization, and clients take them from the daemon, so the proxy's `Status` leaves them unset. - `buck2_server::daemon::proxies` gains the daemon's side of a proxy's lifetime: the launcher and retire hooks, and the supervisor callbacks a launcher gets. On liveness loss the daemon retires and cancels the generation, bounded by the eviction watchdog with the proxy-loss timeout; losing the final tenant's proxy shuts the daemon down and is not recovered. A lost proxy whose tenant had initialized may be replaced by registering a fresh generation, which the supervisor in the commits above decides; a proxy that is lost while its tenant is still initializing evicts the generation and is not replaced, so the client that registered gets the failure and decides whether to try again. - When a generation's eviction completes, its proxy is told to exit through the retire hook; an eviction the daemon exits with, the final tenant's, sends no such message, so that a client waiting for a proxy waits for the daemon too. - Under sharing, the tenant disk lock no longer also waits on the legacy shared-daemon owner, which the proxy handoff replaces. Default mode: nothing here runs without sharing enabled. Reviewed By: JakobDegen Differential Revision: D130030727 fbshipit-source-id: dcfc6ad6922380181778f97981b27d2cb4a9036fgithub.com-facebook-buck2 · e3a5ccda · 2026-11-11