Skip to content

Commit

Permalink
[fix][io] Update Elasticsearch sink idle cnx timeout to 30s (#19377)
Browse files Browse the repository at this point in the history
(cherry picked from commit 1481c74)
(cherry picked from commit fd700da)
  • Loading branch information
michaeljmarshall committed Jan 31, 2023
1 parent 9d9c993 commit 5265cb8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ public void afterBulk(long l, BulkRequest bulkRequest, Throwable throwable) {
this.executorService.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
configCallback.connectionManager.closeExpiredConnections();
configCallback.connectionManager.closeIdleConnections(
config.getConnectionIdleTimeoutInMs(), TimeUnit.MILLISECONDS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ public class ElasticSearchConfig implements Serializable {

@FieldDoc(
required = false,
defaultValue = "5",
help = "Idle connection timeout to prevent a read timeout."
defaultValue = "30000",
help = "Idle connection timeout to prevent a connection timeout due to inactivity."
)
private int connectionIdleTimeoutInMs = 5;
private int connectionIdleTimeoutInMs = 30000;

@FieldDoc(
required = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public final void defaultValueTest() throws IOException {
assertEquals(config.isCompressionEnabled(), false);
assertEquals(config.getConnectTimeoutInMs(), 5000L);
assertEquals(config.getConnectionRequestTimeoutInMs(), 1000L);
assertEquals(config.getConnectionIdleTimeoutInMs(), 5L);
assertEquals(config.getConnectionIdleTimeoutInMs(), 30000L);
assertEquals(config.getSocketTimeoutInMs(), 60000);

assertEquals(config.isStripNulls(), true);
Expand Down

0 comments on commit 5265cb8

Please sign in to comment.