-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix looping forever at 100% CPU if socket is closed #10658
Fix looping forever at 100% CPU if socket is closed #10658
Conversation
Can you please provide a more elaborate explanation (ideally with an example use case) to help understand the reason for this change? Thanks. |
It's a bugfix. The logic is wrong. To reproduce:
|
I still don't follow. Sorry. The reproduction doesn't help because it's incomplete. And I don't understand how it should work. I'm very skeptical about an idling HTTP server saturating the CPU. It should just be in waiting when there's nothing to do. |
The example was from memory simplified from my real code and missing a The existing HTTP::Server ignores closed socket status and spins forever if the socket is closed.
It seems poor form to ignore a public api's ( |
I see, yeah it makes sense now. I suppose the culprit is that The fix looks good overall. We should probably still check |
Perhaps I was micro optimizing but:
|
Okay, you're probably right, this is fine. |
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.
Thank you @didactic-drunk 🙏
Ping: Will this 3 line fix make it in 1.1.0? |
No description provided.