-
Notifications
You must be signed in to change notification settings - Fork 37.8k
Fix reply not sent when event loop terminates prematurely #13492
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
@ken2812221 and @MarcoFalke please review. |
By the way, this is only possible with libevent 2.1.8, so if this is accepted we have to change the minimum version
|
How about we add an infinity timeout timer event before |
@ken2812221 unless there is a strong reason to not bump libevent, that could work too. In that case, it should be enough to remove the timer (instead of |
I am not sure what the exact policy for bumping the minimum version of a dependency is, but we should at least compile on Xenial, which doesn't come with 2.1.8. |
Thanks @MarcoFalke, in that case I'll update with an alternative. WDYT about keeping this for 2.1.8 and provide an alternative for <2.1.8? |
That should be fine, we already do that elsewhere in the code IIRC. |
Concept ACK.
Yes, please do that. Especially the BSDs tend to come with ancient versions of libevent, so please don't change the minimum requirement but put this in |
If the alternative has no downsides, I'd rather say just do the alternative and keep the code more concise and well tested. (note that travis and most developers don't run the old libevent versions) |
Better fix in #13501. |
Fixes #11777. Closes #13485.
When calling RPC
stop
, there is a race when the event loop terminates beforeHTTPRequest::WriteReply
and so the reply event fails to process. This happens becauseevent_base_dispatch
returns when there are no active or pending events, which is the case betweenInterruptHTTPServer
andHTTPRequest::WriteReply
.