Skip to content

Commit

Permalink
[Serve] Minor fix to replica shutdown (ray-project#27778)
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan van der Kleij <[email protected]>
  • Loading branch information
simon-mo authored and Stefan van der Kleij committed Aug 18, 2022
1 parent 95875a5 commit 95f7ce5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/ray/serve/_private/replica.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,9 @@ async def prepare_for_shutdown(self):
if hasattr(self.callable, "__del__"):
# Make sure to accept `async def __del__(self)` as well.
await sync_to_async(self.callable.__del__)()
setattr(self.callable, "__del__", lambda _: None)
except Exception as e:
logger.exception(f"Exception during graceful shutdown of replica: {e}")
finally:
if hasattr(self.callable, "__del__"):
del self.callable.__del__
del self.callable

0 comments on commit 95f7ce5

Please sign in to comment.