@@ -118,16 +118,20 @@ def find_redis_address(address=None):
118
118
# the first argument.
119
119
# Explanation: https://unix.stackexchange.com/a/432681
120
120
# More info: https://github.com/giampaolo/psutil/issues/1179
121
- for arglist in proc .cmdline ():
122
- # Given we're merely seeking --redis-address, we just split
123
- # every argument on spaces for now.
124
- for arg in arglist .split (" " ):
125
- # TODO(ekl): Find a robust solution for locating Redis.
126
- if arg .startswith ("--redis-address=" ):
127
- proc_addr = arg .split ("=" )[1 ]
128
- if address is not None and address != proc_addr :
129
- continue
130
- redis_addresses .add (proc_addr )
121
+ cmdline = proc .cmdline ()
122
+ # NOTE(kfstorm): To support Windows, we can't use
123
+ # `os.path.basename(cmdline[0]) == "raylet"` here.
124
+ if len (cmdline ) > 0 and "raylet" in os .path .basename (cmdline [0 ]):
125
+ for arglist in cmdline :
126
+ # Given we're merely seeking --redis-address, we just split
127
+ # every argument on spaces for now.
128
+ for arg in arglist .split (" " ):
129
+ # TODO(ekl): Find a robust solution for locating Redis.
130
+ if arg .startswith ("--redis-address=" ):
131
+ proc_addr = arg .split ("=" )[1 ]
132
+ if address is not None and address != proc_addr :
133
+ continue
134
+ redis_addresses .add (proc_addr )
131
135
except psutil .AccessDenied :
132
136
pass
133
137
except psutil .NoSuchProcess :
0 commit comments