Ensure that http event loop is empty before the loop exit#13485
Ensure that http event loop is empty before the loop exit#13485ken2812221 wants to merge 1 commit intobitcoin:masterfrom ken2812221:http_shutdown
Conversation
|
This should be simple, I don't think libevent would force such workarounds.
According to the documentation it ignores pending events but active events are handled. And looks like sending the reply is an active event (): Lines 583 to 608 in d6cf4bd Lines 519 to 525 in d6cf4bd Maybe there is a problem in when the the event is activ'ated? |
|
That Lines 229 to 240 in d6cf4bd |
|
@ken2812221 so instead it should make sure the reply is handled before |
|
should make sure the reply is handled before threadHTTP loop exit because the loop can exit earlier than |
|
@ken2812221 Are you still working on this? |
|
@MarcoFalke If necessary, I can work on this again. |
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
Tested 4e79d3e on current master and could run the tests for 24 hours in a loop. (Which is not possible on current master) |
Close #11777
This also revert #11006, since
event_base_loopexitseems to drop unstarted event. So shutdown might take longer.