-
Notifications
You must be signed in to change notification settings - Fork 631
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 too much unclosed sockets (file descriptor) #1413
Conversation
We should consider submitting an issue to actix if the fix is not too hard. |
Sounds good. If it takes too much time for them to merge, we can keep this
fix
…On Fri, Oct 4, 2019 at 6:34 PM Bowen Wang ***@***.***> wrote:
We should consider submitting an issue to actix if the fix is not too hard.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1413>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADFFFCCY4MR2IUGBSOIIJA3QM7VKFANCNFSM4I5VX7XQ>
.
|
chain/telemetry/src/lib.rs
Outdated
@@ -1,8 +1,9 @@ | |||
use std::time::Duration; | |||
use std::u64; |
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.
There is no need to do this. u64::max_value()
is available just fine without this use
.
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.
Good point, fixed now. I'm confusing that why std::u64::max_value()
=> compile error. why it's not equivalent to use std::u64; u64::max_value()
?
(u64::max_value() is just fine without this use too, as you said)
…l/nearcore into fix-too-much-unclosed-handle
@bowenwang1996 @frol Was able to located the bug in actix-http. So in the if branch they want to close the connection, there're two cases: http/1 and http/2. They only handle http/1 case, via some wrapper to pub(crate) enum ConnectionType<Io> {
H1(Io),
H2(SendRequest<Bytes>),
} For H1, they simply do A fix in actix-http I can do is do not close. ignore conn_lifetime and conn_keep_alive param, |
Maybe opening an issue in the actix repo so that you can discuss it with their devs? |
Sounds good! Reported here: actix/actix-web#1123 |
Is this problem fixed? lots of unclosed connection( with status CLOSED_WAIT) occurred, Cargo.toml |
@zyc801208 yes, it fixed the issue for us back then. We don't observe CLOSED_WAIT state connections on our nodes. Please, create a new issue with more information about your setup and mention me there. |
Ok, thank you! |
See #1316
This is a bug of actix_web::client, in short, it will try to close any socket conn that has been opened for conn_lifetime time regardless of conn_keep_alive. The problem is it think it successfully closed connection and happily open a new socket connection, but close isn't actually successful.
My fix is to give it a maximum possible lifetime, this is the simplest fix i can think of (and it works fine locally)
There're likely two other better fixes:
or https://github.com/actix/actix-web/blob/master/actix-http/src/client/pool.rs#L456