make shutdown more robust #1617
Replies: 2 comments 1 reply
-
How can I reproduce it? |
Beta Was this translation helpful? Give feedback.
-
justpy-org/justpy#474 uses a workaround for #1103 since the psutil version does not work on MacOS. So if #1103 would be fixed the workaround would not be necessary. The workaround does not work properly and doesn't call shutdown properly since I didn't understand what do do given as the lenghty discussion of #1103 didn't come to a complexity hiding solution yet. So I end up trying my best and get multiple error mesages one of which is the one mentioned in this discussion. It all boils down to a proper shut down being possible programmatically in a hassle free and platform independent way. |
Beta Was this translation helpful? Give feedback.
-
File "/Users/wf/Library/Python/3.10/lib/python/site-packages/uvicorn/server.py", line 256, in shutdown
for server in self.servers:
AttributeError: 'Server' object has no attribute 'servers'
the code might want to check that self.servers is set before trying the loop. A warning that there are now servers would IMHO be better than an Exception.
Beta Was this translation helpful? Give feedback.
All reactions