mirror of
https://github.com/vale981/ray
synced 2025-03-05 18:11:42 -05:00
This reverts commit 3ce9286977
.
This commit is contained in:
parent
d455cae036
commit
a776209aec
3 changed files with 1 additions and 11 deletions
|
@ -91,12 +91,9 @@ class DashboardAgent(object):
|
|||
async def _check_parent():
|
||||
"""Check if raylet is dead."""
|
||||
curr_proc = psutil.Process()
|
||||
ppid = int(os.environ["RAY_NODE_PID"])
|
||||
logger.info("Parent pid is %s", ppid)
|
||||
while True:
|
||||
parent = curr_proc.parent()
|
||||
if parent is None or parent.pid == 1 or (ppid and
|
||||
ppid != parent.pid):
|
||||
if parent is None or parent.pid == 1:
|
||||
logger.error("raylet is dead, agent will die because "
|
||||
"it fate-shares with raylet.")
|
||||
sys.exit(0)
|
||||
|
|
|
@ -137,11 +137,6 @@ def test_basic(ray_start_with_dashboard):
|
|||
assert agent_proc.pid == agent_pid
|
||||
time.sleep(1)
|
||||
|
||||
# The agent should be dead if raylet exits.
|
||||
raylet_proc.kill()
|
||||
raylet_proc.wait()
|
||||
agent_proc.wait(5)
|
||||
|
||||
# Check redis keys are set.
|
||||
logger.info("Check redis keys are set.")
|
||||
dashboard_address = client.get(dashboard_consts.REDIS_KEY_DASHBOARD)
|
||||
|
|
|
@ -58,10 +58,8 @@ void AgentManager::StartAgent() {
|
|||
}
|
||||
argv.push_back(NULL);
|
||||
// Set node id to agent.
|
||||
static std::string pid_string = std::to_string(getpid());
|
||||
ProcessEnvironment env;
|
||||
env.insert({"RAY_NODE_ID", options_.node_id.Hex()});
|
||||
env.insert({"RAY_NODE_PID", pid_string});
|
||||
Process child(argv.data(), nullptr, ec, false, env);
|
||||
if (!child.IsValid() || ec) {
|
||||
// The worker failed to start. This is a fatal error.
|
||||
|
|
Loading…
Add table
Reference in a new issue