Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove worker events (created, evicted, destroyed) and calculate the …
…worker_pool_stats from the final list of WorkerProcessMetrics. This will log all WorkerPoolStats for all worker pools (even though nothing may have happened) and let us infer what happened from the counts. Also add unknown_destroyed_count and alive_count to the WorkerPoolStats proto (the latter describes the current status of the pool). Some additional points: 1. Worker events are only used to generate the `worker_pool_stats` in the BEP. 2. Since we already keep killed worker metrics (`WorkerProcessMetrics`) around during the build, we don't need this mechanism in (1) to tell us what happened to each worker and just infer directly from the worker metrics. 3. This allows us to have a consistency between the `worker_pool_stats` and worker_metrics in the BEP in terms of the counts. See (4) and (5). 4. Counting worker events can be inaccurate, a worker process can be forcefully killed (`WorkerLifecycleManager#killLargeWorkers`) in one build, and only counted in the next build when the spawn runner realizes that the worker is invalid because the process has already terminated, only then posting a `WorkerDestroyedEvent`. 5. If no workers are killed or created during a build, then the `worker_pool_stats` is empty, which is likely confusing. It would be clearer log all worker pools (even though nothing happened) and let the counts in the proto explicitly tell us what has happened. RELNOTES: Log all WorkerPoolStats for all worker pools (even though workers aren't created or destroyed). Also add unknown_destroyed_count and alive_count to the WorkerPoolStats proto. PiperOrigin-RevId: 588787331
- Loading branch information