Stop all rollout workers.
self.local_worker().stop()
for w in self.remote_workers():
w.stop.remote()
w.__ray_terminate__.remote()
@DeveloperAPI
def foreach_worker(self, func: Callable[[RolloutWorker], T]) -> List[T]:
After Change
Stop all rollout workers.
try:
self.local_worker().stop()
tids = [w.stop.remote()for w in self.remote_workers()]
ray.get(tids)
except Exception:
logger.exception("Failed to stop workers")