From 853969225b81ace054c38a078cba8ede69ba9e77 Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Tue, 5 Sep 2017 20:58:12 -0700 Subject: [PATCH] Sleep longer when starting plasma manager in valgrind case to catch errors where port bind fails. (#934) --- python/ray/plasma/plasma.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/ray/plasma/plasma.py b/python/ray/plasma/plasma.py index 5c0a0243f..64394bde5 100644 --- a/python/ray/plasma/plasma.py +++ b/python/ray/plasma/plasma.py @@ -136,7 +136,10 @@ def start_plasma_manager(store_name, redis_address, # This sleep is critical. If the plasma_manager fails to start because # the port is already in use, then we need it to fail within 0.1 # seconds. - time.sleep(0.1) + if use_valgrind: + time.sleep(1) + else: + time.sleep(0.1) # See if the process has terminated if process.poll() is None: return plasma_manager_name, process, plasma_manager_port