Files
orca/src/shared/lsof-nonblocking-args.ts
T
Brennan Benson 627716fdc1 perf(ports): stop leaving stuck lsof processes behind on a dead network mount (#27729)
* perf(ports): run lsof without blocking on dead network mounts

Without -b, lsof stat()s every mounted file system before answering. A
hard-mounted network share that stops responding blocks that call in the
kernel, so each port scan left an unkillable lsof behind. Pass -b -w to
the lsof queries that name no file (port list, process cwd, executable
path); their output is unchanged. The -U and +D queries keep stat
because -b makes lsof reject named-file arguments.

Linear: STA-9017, STA-9716

* perf(ports): name the stuck lsof helper in the comment; plain readiness test name

* test: query a known child executable in lsof readiness smoke test
2026-10-12 00:55:43 -07:00

6 lines
405 B
TypeScript

// Why: without -b, lsof stat()s every mount in a forked helper, and a dead network mount blocks
// that call in the kernel, leaving an unkillable helper process behind on every scan. -w hides the
// "can't stat()" warnings -b prints. Only for queries that name no file: with -b, lsof rejects
// file arguments such as `-U <path>` or `+D <dir>`.
export const LSOF_NONBLOCKING_ARGS = ['-b', '-w'] as const