-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Serve] gate __del__ call behind hasattr check #18773
[Serve] gate __del__ call behind hasattr check #18773
Conversation
@@ -355,7 +355,8 @@ async def prepare_for_shutdown(self): | |||
# We set the del method to noop after succssifully calling it so the | |||
# destructor is called only once. | |||
try: | |||
self.callable.__del__() | |||
if hasattr(self.callable, "__del__"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it's better to put this outside the whole try-except block, but it's probably not very consequential
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be totally fine!
@@ -355,7 +355,8 @@ async def prepare_for_shutdown(self): | |||
# We set the del method to noop after succssifully calling it so the | |||
# destructor is called only once. | |||
try: | |||
self.callable.__del__() | |||
if hasattr(self.callable, "__del__"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be totally fine!
note to self: this wasn't caught during that commit because the errors are silently logged but not thrown. In the future, we can add logging output test to capture any unexpected output. |
I was having the same issue. @simon-mo why isn't this set to |
@davidberenstein1957 are you still seeing this issue in ray nightly? https://docs.ray.io/en/master/installation.html#daily-releases-nightlies |
Why are these changes needed?
Related issue number
Closes #18772
Checks
scripts/format.sh
to lint the changes in this PR.