-
Notifications
You must be signed in to change notification settings - Fork 14
Ignore disconnects when stopping node #690
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
|
@dsaveliev There's a new github feature for pull requests. When opening one there is a drop down menu in the green "create pull request" button which allows you to open a "draft" pull request. Feel free to make use of it in the future, it's exactly for this purpose (our very own WIP label stems from a time before that) |
14d9038 to
32d95eb
Compare
576fd68 to
22f6210
Compare
Sending the header "Connection: close" makes libevent close persistent connections (implicit with HTTP 1.1) which cleans the event base when shutdown is requested. Signed-off-by: Dmitry Saveliev <[email protected]>
This (almost) move only ensures the event base loop doesn't exit before HTTP worker threads exit. This way events registered by HTTP workers are processed and not discarded. Signed-off-by: Dmitry Saveliev <[email protected]>
Let event base loop exit cleanly by processing all active and pending events. The call is no longer necessary because closing persistent connections is now properly handled. Signed-off-by: Dmitry Saveliev <[email protected]>
Let HTTP connections to timeout due to inactivity. Let all remaning connections finish sending the response and close. Signed-off-by: Dmitry Saveliev <[email protected]>
Signed-off-by: Dmitry Saveliev <[email protected]>
Signed-off-by: Dmitry Saveliev <[email protected]>
22f6210 to
e9adf37
Compare
Signed-off-by: Dmitry Saveliev <[email protected]>
scravy
left a comment
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.
utACK 5f973f8
Looks good to me. I compared it with the bitcoin pull, and this is pretty much the same fix, minus some changes as it's from different branches, but that's fine.
|
@dsaveliev If you put |
thothd
left a comment
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.
Awesome, would be glad to see these floating tests bold green.
@dsaveliev it's probably fixing bunch of more tests than just #367 ?
I think this might be so. Right now I'm running through the floating tests in order to find similar cases. |
|
utACK 5f973f8 Congratulations with the first PR =) |
|
I am not sure we should modify commit messages we take from Bitcoin. I didn't check them all but I see we added |
|
Please do not squash merge this, I will merge-merge this. |
@kostyantyn maybe explain what's the issue with it? I think you've done the same for the ECMH commit |
The problem is that DCO check doesn't pass without signing every single commit, so I was forced to do this. |
That's just partially true. For exactly these cases you can go into the failing check (follow the "Details" link) and "Set DCO to pass" (there's a button). |
|
It's enough to cherry-pick commits. |
Adding the Signed-off-by trailer is fine, I think. As a committer you sign off on the patch of the author. This implies that you have checked that the patch is ok to apply to unit-e. That is actually useful information. |
kostyantyn
left a comment
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.
utACK 5f973f8
As soon as we agree on commit messages as I see we didn't do that for other such PRs.
I think @dsaveliev cherry picked them, just had to adjust the code a bit since it's quite a recent Bitcoin code |
|
Great, I will merge-merge this then. |
Ignore disconnects when stopping node - fixes #367
This is a port of bitcoin/bitcoin#14670
This problem is related to the "stop" RPC call.
It turns out that sometimes the node stops before it sends the response.
That causes the client to retry the call and lead to "ConnectionRefusedError".
I found out that there is a fix in bitcoin repo (in master branch, actually), related to this bug.
In the nutshell, this changes remove forced exit of libevent loop, which allows
to process all the requests gracefully.
Test feature_shutdown.py wasn't ported because it introduces a bug bitcoin/bitcoin#14670 (comment)
The "improvement" bitcoin/bitcoin#14958 requires RPC method "getrpcinfo" which isn't ported from the bitcoin codebase yet.
There are other floating tests with a similar error (ConnectionRefusedError):
fixes #373
fixes #484
fixes #544
Test runs:
rpc_fundrawtransaction.py - https://travis-ci.com/dsaveliev/unit-e/builds/102691551
feature_notifications.py - https://travis-ci.com/dsaveliev/unit-e/builds/102777885
mempool_packages.py - https://travis-ci.com/dsaveliev/unit-e/builds/102779373
feature_cltv.py - https://travis-ci.com/dsaveliev/unit-e/builds/102784432
Signed-off-by: Dmitry Saveliev [email protected]