mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 11:37:28 +08:00
Consodiate CI Python tests and fix bug about multiple ray.init (#4195)
This commit is contained in:
committed by
Robert Nishihara
parent
9c48cc27aa
commit
6f1a29ad3f
@@ -57,9 +57,11 @@ class RemoteFunction(object):
|
||||
self._function_signature = ray.signature.extract_signature(
|
||||
self._function)
|
||||
|
||||
# # Export the function.
|
||||
# Export the function.
|
||||
worker = ray.worker.get_global_worker()
|
||||
worker.function_actor_manager.export(self)
|
||||
# In which session this function was exported last time.
|
||||
self._last_export_session = worker._session_index
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
raise Exception("Remote functions cannot be called directly. Instead "
|
||||
@@ -97,6 +99,13 @@ class RemoteFunction(object):
|
||||
"""An experimental alternate way to submit remote functions."""
|
||||
worker = ray.worker.get_global_worker()
|
||||
worker.check_connected()
|
||||
|
||||
if self._last_export_session < worker._session_index:
|
||||
# If this function was exported in a previous session, we need to
|
||||
# export this function again, because current GCS doesn't have it.
|
||||
self._last_export_session = worker._session_index
|
||||
worker.function_actor_manager.export(self)
|
||||
|
||||
kwargs = {} if kwargs is None else kwargs
|
||||
args = ray.signature.extend_args(self._function_signature, args,
|
||||
kwargs)
|
||||
|
||||
Reference in New Issue
Block a user