Remove default value for read_timeout setting

Fix tests and docs
This commit is contained in:
Alexander Kazakov 2016-12-05 21:29:17 +03:00
parent 5695eaf19e
commit 1491e2dec9
8 changed files with 19 additions and 22 deletions

View File

@ -133,8 +133,9 @@ with the right signer to use.
===== Read timeout ===== Read timeout
Read timeout determines the amount of time to wait for data to be transferred over an established, Read timeout determines the amount of time to wait for data to be transferred over an established,
open connection before the connection is timed out. By default,it is set to 50 seconds. open connection before the connection is timed out.
It can be configured with `cloud.aws.read_timeout` setting: It can be configured with `cloud.aws.read_timeout` (or `cloud.aws.ec2.read_timeout`) setting:
[source, yaml] [source, yaml]
---- ----
cloud.aws.read_timeout: 30s cloud.aws.read_timeout: 30s
@ -188,12 +189,6 @@ The following are a list of settings (prefixed with `discovery.ec2`) that can fu
How long the list of hosts is cached to prevent further requests to the AWS API. How long the list of hosts is cached to prevent further requests to the AWS API.
Defaults to `10s`. Defaults to `10s`.
`read_timeout`::
The amount of time to wait for data to be transferred over an established,
open connection before the connection is timed out. Default to value of `cloud.aws.read_timeout`.
[IMPORTANT] [IMPORTANT]
.Binding the network host .Binding the network host
============================================== ==============================================

View File

@ -141,8 +141,9 @@ use `S3SignerType`, which is Signature Version 2.
===== Read timeout ===== Read timeout
Read timeout determines the amount of time to wait for data to be transferred over an established, Read timeout determines the amount of time to wait for data to be transferred over an established,
open connection before the connection is timed out. By default,it is set to 50 seconds. open connection before the connection is timed out.
It can be configured with `cloud.aws.read_timeout` setting: It can be configured with `cloud.aws.read_timeout` (or `cloud.aws.s3.read_timeout`) setting:
[source, yaml] [source, yaml]
---- ----
cloud.aws.read_timeout: 30s cloud.aws.read_timeout: 30s
@ -264,12 +265,6 @@ The following settings are supported:
The default behaviour is to detect which access style to use based on the configured endpoint (an IP will result The default behaviour is to detect which access style to use based on the configured endpoint (an IP will result
in path-style access) and the bucket being accessed (some buckets are not valid DNS names). in path-style access) and the bucket being accessed (some buckets are not valid DNS names).
`read_timeout`::
The amount of time to wait for data to be transferred over an established,
open connection before the connection is timed out. Default to value of `cloud.aws.read_timeout`.
Note that you can define S3 repository settings for all S3 repositories in `elasticsearch.yml` configuration file. Note that you can define S3 repository settings for all S3 repositories in `elasticsearch.yml` configuration file.
They are all prefixed with `repositories.s3.`. For example, you can define compression for all S3 repositories They are all prefixed with `repositories.s3.`. For example, you can define compression for all S3 repositories
by setting `repositories.s3.compress: true` in `elasticsearch.yml`. by setting `repositories.s3.compress: true` in `elasticsearch.yml`.

View File

@ -83,7 +83,7 @@ public interface AwsEc2Service {
/** /**
* cloud.aws.read_timeout: Socket read timeout. Shared with repository-s3 plugin * cloud.aws.read_timeout: Socket read timeout. Shared with repository-s3 plugin
*/ */
Setting<TimeValue> READ_TIMEOUT = Setting.timeSetting("cloud.aws.read_timeout", TimeValue.timeValueSeconds(50), Setting<TimeValue> READ_TIMEOUT = Setting.timeSetting("cloud.aws.read_timeout", TimeValue.MINUS_ONE,
Property.NodeScope, Property.Shared); Property.NodeScope, Property.Shared);
/** /**

View File

@ -125,7 +125,10 @@ public class AwsEc2ServiceImpl extends AbstractComponent implements AwsEc2Servic
10, 10,
false); false);
clientConfiguration.setRetryPolicy(retryPolicy); clientConfiguration.setRetryPolicy(retryPolicy);
clientConfiguration.setSocketTimeout((int) CLOUD_EC2.READ_TIMEOUT.get(settings).millis());
if (READ_TIMEOUT.exists(settings) || CLOUD_EC2.READ_TIMEOUT.exists(settings)) {
clientConfiguration.setSocketTimeout((int) CLOUD_EC2.READ_TIMEOUT.get(settings).millis());
}
return clientConfiguration; return clientConfiguration;
} }

View File

@ -72,7 +72,8 @@ public class AwsEc2ServiceImplTests extends ESTestCase {
} }
public void testAWSDefaultConfiguration() { public void testAWSDefaultConfiguration() {
launchAWSConfigurationTest(Settings.EMPTY, Protocol.HTTPS, null, -1, null, null, null, 50000); launchAWSConfigurationTest(Settings.EMPTY, Protocol.HTTPS, null, -1, null, null, null,
ClientConfiguration.DEFAULT_SOCKET_TIMEOUT);
} }
public void testAWSConfigurationWithAwsSettings() { public void testAWSConfigurationWithAwsSettings() {

View File

@ -80,7 +80,7 @@ public interface AwsS3Service extends LifecycleComponent {
/** /**
* cloud.aws.read_timeout: Socket read timeout. Shared with discovery-ec2 plugin * cloud.aws.read_timeout: Socket read timeout. Shared with discovery-ec2 plugin
*/ */
Setting<TimeValue> READ_TIMEOUT = Setting.timeSetting("cloud.aws.read_timeout", TimeValue.timeValueSeconds(50), Setting<TimeValue> READ_TIMEOUT = Setting.timeSetting("cloud.aws.read_timeout", TimeValue.MINUS_ONE,
Property.NodeScope, Property.Shared); Property.NodeScope, Property.Shared);
/** /**

View File

@ -116,7 +116,9 @@ public class InternalAwsS3Service extends AbstractLifecycleComponent implements
AwsSigner.configureSigner(awsSigner, clientConfiguration, endpoint); AwsSigner.configureSigner(awsSigner, clientConfiguration, endpoint);
} }
clientConfiguration.setSocketTimeout((int) CLOUD_S3.READ_TIMEOUT.get(settings).millis()); if (READ_TIMEOUT.exists(settings) || CLOUD_S3.READ_TIMEOUT.exists(settings)) {
clientConfiguration.setSocketTimeout((int) CLOUD_S3.READ_TIMEOUT.get(settings).millis());
}
return clientConfiguration; return clientConfiguration;
} }

View File

@ -143,7 +143,8 @@ public class AwsS3ServiceImplTests extends ESTestCase {
public void testAWSDefaultConfiguration() { public void testAWSDefaultConfiguration() {
Settings repositorySettings = generateRepositorySettings(null, null, "eu-central", null, null); Settings repositorySettings = generateRepositorySettings(null, null, "eu-central", null, null);
launchAWSConfigurationTest(Settings.EMPTY, repositorySettings, Protocol.HTTPS, null, -1, null, null, null, 3, false, 50000); launchAWSConfigurationTest(Settings.EMPTY, repositorySettings, Protocol.HTTPS, null, -1, null, null, null, 3, false,
ClientConfiguration.DEFAULT_SOCKET_TIMEOUT);
} }
public void testAWSConfigurationWithAwsSettings() { public void testAWSConfigurationWithAwsSettings() {