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

set connection TTL #7

Merged
merged 1 commit into from
Mar 5, 2025
Merged

set connection TTL #7

merged 1 commit into from
Mar 5, 2025

Conversation

yas-okadatech
Copy link

Rarely, error "The target server failed to respond" happens.
If a disconnected connection (in connection pool) is reused, this error happens.

So I fixed it to set connection TTL. (default value is -1 and it means connections do not expire)

ref: https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/ClientConfiguration.html#setConnectionTTL-long-

@yas-okadatech yas-okadatech self-assigned this Mar 4, 2025
@kentoyoshida kentoyoshida requested a review from Copilot March 5, 2025 02:23

Choose a reason for hiding this comment

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

PR Overview

This PR addresses a sporadic "The target server failed to respond" error by setting the connection TTL in the client configuration to 30 seconds.

  • Sets the connection TTL from the default (-1) to 30 seconds.
  • Aims to mitigate issues caused by reusing disconnected connections in the connection pool.

Reviewed Changes

File Description
src/main/java/org/embulk/input/cloudwatch_logs/AbstractCloudwatchLogsInputPlugin.java Updated client configuration to set a connection TTL of 30 seconds

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/main/java/org/embulk/input/cloudwatch_logs/AbstractCloudwatchLogsInputPlugin.java:228

  • [nitpick] Consider making the TTL value configurable rather than hardcoding it to 30 seconds to better accommodate varying deployment environments and usage patterns.
clientConfig.setConnectionTTL(30 * 1000); // default: -1
Copy link

@kentoyoshida kentoyoshida left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! LGTM!

@yas-okadatech yas-okadatech merged commit 8cdf365 into master Mar 5, 2025
4 checks passed
@yas-okadatech yas-okadatech deleted the 29366-ttl branch March 5, 2025 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants