forked from Hirni-Meshram2/pants
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix python process name extraction. (pantsbuild#11966)
Previously we grabbed the 1st 15 characters on Linux and, at least on some versions of macOS, we didn't grab the process name at all, but the actual name of the process executable instead. Since pantsd uses process re-naming to leave a fingerprint it can use to detect its last recorded pid has not been recycled to another process, the macOS case is problematic. In our case, the process executable for pantsd is a Python binary and processes with that as their executable are ubiquitous. This defeats the pid recycling detection scheme. Fix all this by grabbing the process name from the right place, only falling back to the prior if there is a problem reading the process command line (can happen for zombie processes at least). Add an integration test that verifies we now read the full custom command line and not a truncated version of it or the name of the process executable.
- Loading branch information
Showing
2 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters