Stop the process-list pipeline writing broken-pipe noise to stderr
This commit is contained in:
@@ -427,7 +427,10 @@ function vv_memory_breakdown(): array {
|
||||
|
||||
// Top processes by RSS — group same-named procs, take top 5
|
||||
$grouped = [];
|
||||
$psOut = shell_exec("ps -eo comm,rss --sort=-rss 2>/dev/null | tail -n +2 | head -40") ?: '';
|
||||
// stderr silenced for the pipeline, not just for ps: head -40 exits on the fortieth line and
|
||||
// leaves tail writing into a closed pipe, which tail reports. Harmless, but it went to stderr
|
||||
// once a minute from the cache writer on both hosts, and the repair sweep reads that log.
|
||||
$psOut = shell_exec("{ ps -eo comm,rss --sort=-rss | tail -n +2 | head -40; } 2>/dev/null") ?: '';
|
||||
foreach (explode("\n", trim($psOut)) as $line) {
|
||||
$parts = preg_split('/\s+/', trim($line), 2);
|
||||
if (count($parts) === 2 && is_numeric($parts[1]) && (int)$parts[1] > 0)
|
||||
|
||||
Reference in New Issue
Block a user