mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
RLlib: Fix bug: WorkerSet.stop()
will raise error if self._local_worker
is None (e.g. in evaluation worker sets). (#25332)
This commit is contained in:
parent
6fe8f7e16b
commit
87c9fdd0f8
1 changed files with 2 additions and 1 deletions
|
@ -342,7 +342,8 @@ class WorkerSet:
|
|||
def stop(self) -> None:
|
||||
"""Calls `stop` on all rollout workers (including the local one)."""
|
||||
try:
|
||||
self.local_worker().stop()
|
||||
if self.local_worker():
|
||||
self.local_worker().stop()
|
||||
tids = [w.stop.remote() for w in self.remote_workers()]
|
||||
ray.get(tids)
|
||||
except Exception:
|
||||
|
|
Loading…
Add table
Reference in a new issue