Ignore blocking ray.wait if timeout is zero (#6891)

This commit is contained in:
Simon Mo
2020-01-22 16:05:34 -08:00
committed by GitHub
parent 6bb30c9f1b
commit 4dd41844d0
2 changed files with 9 additions and 3 deletions
+3 -3
View File
@@ -1573,9 +1573,9 @@ def wait(object_ids, num_returns=1, timeout=None):
"""
worker = global_worker
if hasattr(
worker,
"core_worker") and worker.core_worker.current_actor_is_asyncio():
if hasattr(worker,
"core_worker") and worker.core_worker.current_actor_is_asyncio(
) and timeout != 0:
raise RayError("Using blocking ray.wait inside async method. "
"This blocks the event loop. Please use `await` "
"on object id with asyncio.wait. ")