-
-
Notifications
You must be signed in to change notification settings - Fork 803
Fix missing self.servers exception #1845
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
Conversation
What's your goal? |
To prevent an unexpected exception from occuring if something is taking the requested Uvicorn port during Now, uvicorn will now properly log that the port is busy during the self-activated |
Do you have a snippet that demonstrates what you mean? |
Not exactly a snippet, but the process I've done to create this exception is:
|
I'd appreciate an MRE. 👀 |
Sure I'll draft one in a bit |
Ok 👀 |
Oops, thanks for the reminder. MRE generated. See the readme for steps to reproduce. https://github.com/Archmonger/uvicorn-server-exception This issue can only be reproduced when With the changes in this PR, everything seems to be handled gracefully. |
So it cannot be reproduced with uvicorn standalone? |
Not from my one quick test.
Not entirely sure how that's causing this problem, but it does look like uvicorn's |
This is the first time I'm seeing this issue, and it doesn't look like is reproducible against uvicorn standalone... Even if it's one line, I need a proof that the issue is here, and I can only have that if it's possible to reproduce with only uvicorn. |
No problem. I'm actually seeing that this issue is ultimately caused by this LOC in IDOM. Although the variable safety issue still exists within I will refactor the server running logic in IDOM. |
If another webserver is currently parked on uvicorn's port, then this exception will occur:
This PR ensures
self.servers
is always initialized so the error can be handled gracefully.