Skip to content
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] [Bug] Redeploying function causes "AttributeError: 'function' object has no attribute '__del__'" #18772

Closed
2 tasks done
architkulkarni opened this issue Sep 20, 2021 · 1 comment · Fixed by #18773
Closed
2 tasks done
Labels
bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component)

Comments

@architkulkarni
Copy link
Contributor

architkulkarni commented Sep 20, 2021

Search before asking

  • I searched the issues and found no similar issues.

Ray Component

Ray Serve

What happened + What you expected to happen

Deploying a function twice gives the following traceback:

2021-09-20 15:59:17,902 INFO api.py:243 -- Updating deployment 'f'. component=serve deployment=f
(pid=87851) 2021-09-20 15:59:17,906     INFO backend_state.py:854 -- Stopping 1 replicas of deployment 'f' with outdated versions. component=serve deployment=f OLD VERSION: wLDnZI  NEW VERSION: nVoLLY
(pid=87853) 2021-09-20 15:59:19,909     ERROR backend_worker.py:360 -- Exception during graceful shutdown of replica. component=serve deployment=f replica=f#DrtNqg
(pid=87853) Traceback (most recent call last):
(pid=87853)   File "/Users/archit/ray/python/ray/serve/backend_worker.py", line 358, in prepare_for_shutdown
(pid=87853)     self.callable.__del__()
(pid=87853) AttributeError: 'function' object has no attribute '__del__'
(pid=87851) 2021-09-20 15:59:20,072     INFO backend_state.py:898 -- Adding 1 replicas to deployment 'f'. component=serve deployment=f
2021-09-20 15:59:20,400 INFO api.py:251 -- Deployment 'f' is ready at `http://127.0.0.1:8000/f`. component=serve deployment=f

Reproduction script

from ray import serve
@serve.deployment
def f(request):
    return "Hi"
serve.start()
f.deploy()
f.deploy()

Anything else

Occurs on master
No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!
@architkulkarni architkulkarni added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Sep 20, 2021
@simon-mo
Copy link
Contributor

nice catch. can you make a quick fix? you can just gate that line with hasattr(self, callable, "__del__")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants