perf(server): Grok sessions on Linux stop polling /proc while a cgroup owns teardown #19255
Closedayagmar(GitHub profile, opens in a new tab)wants to merge 1 commit into
main fromrefs/pull/19255/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
- @@ -2368 +2368,21 @@236823682369+ it.live("does not poll the process ledger while a cgroup lease owns teardown", () =>2370+ Effect.gen(function* () {2371+ if ((yield* HostProcess.Platform) !== "linux") return;2372+ const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;2373+ const fileSystem = yield* FileSystem.FileSystem;2374+ const path = yield* Path.Path;2375+ const selfInvocation = yield* resolveSelfInvocation();2376+ const mockAgentPath = yield* path.fromFileUrl(2377+ new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),2378+ );2379+ // A directory stands in for cgroupfs: the join wrapper appends the agent2380+ // PID to cgroup.procs and stays in this process's cgroup, which is the2381+ // cgroup the lease reports.2382+ const leasePath = yield* fileSystem.makeTempDirectoryScoped();2383+ const procsPath = path.join(leasePath, "cgroup.procs");2384+ yield* fileSystem.writeFileString(procsPath, "");2385+ const relativePath = AcpSessionRuntime.parseUnifiedCgroupPath(2386+ NodeFS.readFileSync("/proc/self/cgroup", "utf8"),2387+ );2388+ assert.isDefined(relativePath);
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes