Raise error if space in redis password (#5673)

This commit is contained in:
Edward Oakes 2019-09-11 20:58:39 -07:00 committed by Philipp Moritz
parent 0bf79cfbde
commit ee5db5b67f
2 changed files with 5 additions and 0 deletions

View file

@ -116,6 +116,9 @@ behind a firewall, this feature is useful for instances exposed to the internet
where configuring a firewall is not possible. Because Redis is
very fast at serving queries, the chosen password should be long.
.. note:: The Redis passwords provided below may not contain spaces.
Redis authentication is only supported on the raylet code path.
To add authentication via the Python API, start Ray using:

View file

@ -772,6 +772,8 @@ def _start_redis_instance(executable,
# Construct the command to start the Redis server.
command = [executable]
if password:
if " " in password:
raise ValueError("Spaces not permitted in redis password.")
command += ["--requirepass", password]
command += (
["--port", str(port), "--loglevel", "warning"] + load_module_args)