Skip to content

Offload pid parsing to OS to reduce returned buffer size

Compare
Choose a tag to compare
@evantahler evantahler released this 11 Oct 19:26
· 988 commits to main since this release

When getting a list of all runing PIDs on this host (so we can cleanup any previously crashed workers), we had previously taken in the whole PS string and parsed it in Node. If your OS is busy, this list can be quite large and crash your application. Now, we'll offload some of the parsing of this list to AWK (another process) and only get back a list of PIDs to parse.

This shouldn't harm compatibility, as AWK is ubiquitous as GREP.