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

Resolve intermittent premature connection closed #19808

Merged
merged 1 commit into from
Jun 11, 2018

Conversation

tylersmalley
Copy link
Contributor

@tylersmalley tylersmalley commented Jun 11, 2018

Node 8 changed the keepAlive default to 5 seconds from 5 minutes. This reverts that behavior.

Having this low of a keepAlive timeout is problematic for health checks. For example, if you have a Load Balancer health check on a 5-second interval, the initial request starts the keepAlive and it's possible a subsequent request uses the keepAlive and is destroyed before it has been completed.

hapijs/hapi#3738

Node 8 changed the keepAlive to default to 5 seconds from 5 minutes. This reverts that behavior.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
@@ -47,6 +51,9 @@ export function setupConnection(server, config) {
}
});

// revert to previous 5m keepalive timeout in Node < 8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, 2m

Copy link
Contributor

@joegallo joegallo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jbudz
Copy link
Member

jbudz commented Jun 11, 2018

https://nodejs.org/api/http.html#http_server_keepalivetimeout has a blurb about it. New setting in Node 8. It mentions setting this to 0 for the same behavior as < 8 but 120 is effectively the same as it falls back to the timeout option above.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@tylersmalley tylersmalley merged commit c360fca into elastic:6.3 Jun 11, 2018
tylersmalley added a commit that referenced this pull request Jun 11, 2018
Node 8 changed the keepAlive to default to 5 seconds from 5 minutes. This reverts that behavior.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
tylersmalley added a commit that referenced this pull request Jun 11, 2018
Node 8 changed the keepAlive to default to 5 seconds from 5 minutes. This reverts that behavior.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
@tylersmalley
Copy link
Contributor Author

6.x/6.4: 83dd263
7.0: ec69a02

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

maryia-lapata pushed a commit to maryia-lapata/kibana that referenced this pull request Jun 25, 2018
Node 8 changed the keepAlive to default to 5 seconds from 5 minutes. This reverts that behavior.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
jbudz pushed a commit to jbudz/kibana that referenced this pull request Mar 6, 2019
Node 8 changed the keepAlive to default to 5 seconds from 5 minutes. This reverts that behavior.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
jbudz added a commit that referenced this pull request Mar 8, 2019
* Bump node to 6.17.0

* Resolve intermittent premature connection closed (#19808)

Node 8 changed the keepAlive to default to 5 seconds from 5 minutes. This reverts that behavior.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants