mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
![]() When using ray inside a virtualenv on windows, python.exe as reported by sys.executable is a PEP397 launcher to the actual python as reported by os.getpid(): >>> import sys, os, psutil >>> >>> print(sys.executable) C:\temp\issue24361\Scripts\python.exe >>> os.getpid() 2208 >>> child = psutil.Process(2208) >>> child.cmdline() ['C:\\oss\\CPython38\\python.exe'] >>> child.parent().cmdline() ['C:\\temp\\issue24361\\Scripts\\python.exe'] >>> child.parent().pid 6424 When the agent_manager launches the agent process via Process::Process(), it gets the PID of the launcher process (6424), which is what is expected as an ID when registering the agent in the gRPC callback. But inside agent.py, the child process reports the PID via os.getpid(), which is 2208, and this is the wrong PID to register the agent. The solution proposed here is another version of #24905 that creates a int agent_id = rand(); before starting the python process, and passes the agent_id to the process. |
||
---|---|---|
.. | ||
client | ||
modules | ||
tests | ||
__init__.py | ||
agent.py | ||
BUILD | ||
consts.py | ||
dashboard.py | ||
datacenter.py | ||
head.py | ||
http_server_agent.py | ||
http_server_head.py | ||
k8s_utils.py | ||
memory_utils.py | ||
optional_deps.py | ||
optional_utils.py | ||
state_aggregator.py | ||
utils.py |