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

HttpServerConnection: Don't spawn useless coroutines #10247

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

yhabteab
Copy link
Member

Backport of #10214

Currently, for each `Disconnect()` call, we spawn a coroutine, but every
one of them is just usesless, except the first one. However, since all
`Disconnect()` usages share the same asio strand and cannot interfere
with each other, spawning another coroutine within `Disconnect()` isn't
even necessary. When a coroutine calls `Disconnect()` now, it will
immediately initiate an async shutdown of the socket, potentially causing
the coroutine to yield and allowing the others to resume. Therefore, the
`m_ShuttingDown` flag is still required by the coroutines to be checked
regularly.
@yhabteab yhabteab requested a review from julianbrost November 19, 2024 15:10
@icinga-probot icinga-probot bot added this to the 2.14.4 milestone Nov 19, 2024
@cla-bot cla-bot bot added the cla/signed label Nov 19, 2024
@icinga-probot icinga-probot bot added the bug Something isn't working label Nov 19, 2024
@yhabteab yhabteab enabled auto-merge November 19, 2024 15:12
@yhabteab yhabteab merged commit 4e91fd7 into support/2.14 Nov 19, 2024
27 checks passed
@yhabteab yhabteab deleted the useless-http-coroutines-214 branch November 19, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants