mirror of
https://github.com/wassname/ray.git
synced 2026-09-10 12:38:43 +08:00
Fix dashboard agent check ppid is raylet pid (#12256)
* Dashboard agent check ppid is raylet pid * Improve implementation * Refine code * Make the RAY_NODE_PID environment required for dashboard agent Co-authored-by: 刘宝 <po.lb@antfin.com>
This commit is contained in:
@@ -58,8 +58,10 @@ 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.
|
||||
|
||||
Reference in New Issue
Block a user