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

fix(aws_s3 sink): close idle connections for aws s3 sinks #9703

Merged
merged 2 commits into from
Oct 20, 2021

Conversation

vladimir-dd
Copy link
Contributor

@vladimir-dd vladimir-dd commented Oct 19, 2021

Fixes #9671 (potentially)
We suspect that S3 closes idle connections after 20sec while hyper preparing a new request. Hyper closes idle connections after 90sec by default, so we should decrease this timeout to something less than 20sec to avoid reusing closed connections. See this thread.
Signed-off-by: Vladimir Zhuk vladimir.zhuk@datadoghq.com

Fixes #9671
Signed-off-by: Vladimir Zhuk <vladimir.zhuk@datadoghq.com>
@netlify
Copy link

netlify bot commented Oct 19, 2021

✔️ Deploy Preview for vector-project canceled.

🔨 Explore the source changes: ee46a62

🔍 Inspect the deploy log: https://app.netlify.com/sites/vector-project/deploys/616fdc979982af00082b9e4b

@vladimir-dd vladimir-dd changed the title fix(s3 sink): close idle connections for aws s3 sinks fix(aws_s3 sink): close idle connections for aws s3 sinks Oct 19, 2021
@vladimir-dd vladimir-dd self-assigned this Oct 19, 2021
@vladimir-dd vladimir-dd added the sink: aws_s3 Anything `aws_s3` sink related label Oct 19, 2021
@vladimir-dd vladimir-dd requested a review from tobz October 19, 2021 14:44
Copy link
Contributor

@tobz tobz left a comment

Choose a reason for hiding this comment

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

LGTM. One small suggestion.

proxy,
// S3 closes idle connections after 20 seconds,
// so we can close idle connections ahead of time to prevent re-using them
client::Client::builder().pool_idle_timeout(Duration::from_secs(10)),
Copy link
Contributor

Choose a reason for hiding this comment

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

Small quibble: I'd change this to 15 seconds just to utilize a little more of the 20 second window.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we not couple both timeouts with a shared constant or something? And shouldn't we explicitly set the 20 second timeout as well in case that changes in the future?

Copy link
Member

Choose a reason for hiding this comment

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

👍 to 15s instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've not found any shared aws constant that we could rely on(I could create our own, but that wouldn't help much in case it changes on the aws side), so will just change it to 15sec.

proxy,
// S3 closes idle connections after 20 seconds,
// so we can close idle connections ahead of time to prevent re-using them
client::Client::builder().pool_idle_timeout(Duration::from_secs(10)),
Copy link
Member

Choose a reason for hiding this comment

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

👍 to 15s instead.

Signed-off-by: Vladimir Zhuk <vladimir.zhuk@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sink: aws_s3 Anything `aws_s3` sink related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The aws_s3 sink is logging connection_closed_before_message_completed errors
4 participants