-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Right now, we use psutil to get the parent's pid and check if parent pid is changed to figure out if the parent is dead. This works most of time, but there's a rare edge case (from psutil) where this mechanism doesn't work. psutil has a process identifier based on (pid, creation_time), but if the system clock is synchronized again, the creation time could be changed. See the related issue for more details. Since agent death == raylet death, this edge case is still critical although it is rare. We fix the issue by using more reliable health checking; parent opens up a pipe and redirect to the child process stdin. Child process reads stdin. If stdin returns 0 bytes, it means the parent is dead (see https://stackoverflow.com/questions/12193581/detect-death-of-parent-process). This is the same mechanism we are using to detect worker failure from raylet (but opposite direction). Note that the PR is a bit ugly because I made a feature flag for this feature. Since it is the last minute PR merge, we should be careful, and that's why I added the feature flag.
- Loading branch information
Showing
9 changed files
with
188 additions
and
63 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
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
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
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
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