Register function race (#9346)

This commit is contained in:
Alex Wu
2020-07-28 13:51:34 -07:00
committed by GitHub
parent c00742f103
commit 21af0ceb0c
4 changed files with 10 additions and 9 deletions
+7 -3
View File
@@ -136,9 +136,13 @@ class ImportThread:
ray_constants.DUPLICATE_REMOTE_FUNCTION_THRESHOLD)
if key.startswith(b"RemoteFunction"):
with profiling.profile("register_remote_function"):
(self.worker.function_actor_manager.
fetch_and_register_remote_function(key))
# TODO (Alex): There's a race condition here if the worker is
# shutdown before the function finished registering (because core
# worker's global worker is unset before shutdown and is needed
# for profiling).
# with profiling.profile("register_remote_function"):
(self.worker.function_actor_manager.
fetch_and_register_remote_function(key))
elif key.startswith(b"FunctionsToRun"):
with profiling.profile("fetch_and_run_function"):
self.fetch_and_execute_function_to_run(key)
+1 -1
View File
@@ -41,7 +41,7 @@ class RemoteFunction:
_num_return_vals: The default number of return values for invocations
of this remote function.
_max_calls: The number of times a worker can execute this function
before executing.
before exiting.
_decorator: An optional decorator that should be applied to the remote
function invocation (as opposed to the function execution) before
invoking the function. The decorator must return a function that
+2 -1
View File
@@ -202,7 +202,8 @@ def test_profiling_api(ray_start_2_cpus):
"ray.wait",
"submit_task",
"fetch_and_run_function",
"register_remote_function",
# TODO (Alex) :https://github.com/ray-project/ray/pull/9346
# "register_remote_function",
"custom_event", # This is the custom one from ray.profile.
]