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

Expose additional configuration options for Http connection manager #204

Merged
merged 34 commits into from
Sep 7, 2022

Conversation

waahm7
Copy link
Contributor

@waahm7 waahm7 commented Aug 22, 2022

Issue #, if available: awslabs/aws-crt-java#502 & aws/aws-sdk-cpp#1882

Description of changes:

  • Exposes proxy options
  • Exposes KeepAlive options
  • Exposes connect_timeout_ms
  • Exposes monitoring options
  • Exposes proxy_env_var_settings

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@waahm7 waahm7 requested a review from TingDaoK August 22, 2022 16:46
include/aws/s3/private/s3_client_impl.h Outdated Show resolved Hide resolved
include/aws/s3/s3_client.h Show resolved Hide resolved
@waahm7 waahm7 changed the title Exposes proxy options WIP - Exposes proxy options Aug 22, 2022
source/s3_client.c Outdated Show resolved Hide resolved
@waahm7 waahm7 changed the title WIP - Exposes proxy options WIP - Expose additional configuration options for Http connection manager Aug 25, 2022
include/aws/s3/s3_client.h Outdated Show resolved Hide resolved
struct aws_s3_tcp_keep_alive_options {

/* Set keepalive true to periodically transmit messages for detecting a disconnected peer.*/
bool keepalive;
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need bool here? wouldnt null keep alive indicate keep alive is on?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean null keep alive will indicate that keep alive is off? Since it is just a normal struct, it can't be null. We can turn it into a pointer and remove the keepalive. If the pointer is null, that would mean keepalive is off and vice versa.

Otherwise, we need a keepalive variable so that users can just set keepalive to true and use default values for the rest. This is basically a partial struct from aws_socket_options which has two extra fields  enum aws_socket_type type and enum aws_socket_domain domain. I didn't want to allow users to override these two fields.

include/aws/s3/private/s3_client_impl.h Show resolved Hide resolved
include/aws/s3/private/s3_client_impl.h Outdated Show resolved Hide resolved
include/aws/s3/private/s3_client_impl.h Show resolved Hide resolved
source/s3_client.c Outdated Show resolved Hide resolved
Comment on lines +318 to +324
if (client_config->proxy_ev_settings->tls_options) {
client->proxy_ev_tls_options = aws_mem_calloc(allocator, 1, sizeof(struct aws_tls_connection_options));
if (aws_tls_connection_options_copy(client->proxy_ev_tls_options, client->proxy_ev_settings->tls_options)) {
goto on_error;
}
client->proxy_ev_settings->tls_options = client->proxy_ev_tls_options;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a better way to deep copy proxy_ev_settings->tls_options? The problem is that in proxy_ev_settings, tls_options is declared as const. So if I just use that directly instead of using client->proxy_ev_tls_options, I get a bunch of warnings about passing const tls_options to other functions which expect a non-const object like aws_mem_release.

Comment on lines +307 to +312
if (client_config->proxy_options) {
client->proxy_config = aws_http_proxy_config_new_from_proxy_options(allocator, client_config->proxy_options);
if (client->proxy_config == NULL) {
goto on_error;
}
}
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 am unable to write a test for the proxy_config override. As the struct proxy_config implementation detail is private in the aws-c-http repo, I can't access its members to assert.

@waahm7 waahm7 marked this pull request as ready for review August 30, 2022 15:43
@waahm7 waahm7 changed the title WIP - Expose additional configuration options for Http connection manager Expose additional configuration options for Http connection manager Aug 30, 2022
@waahm7 waahm7 merged commit 3d9174d into main Sep 7, 2022
@waahm7 waahm7 deleted the expose-proxy-config branch September 7, 2022 16:41
grrtrr added a commit to grrtrr/aws-sdk-cpp that referenced this pull request Sep 21, 2022
Based on awslabs/aws-c-s3#204, this exposes the following
`ClientConfiguration` options to CRT:
- `connect_timeout_ms`: S3 socket connection timeout;
- `enableTcpKeepAlive`: enable TCP keep-alive probes;
- `tcpKeepAliveIntervalMs`: TCP keep-alive wait/probe interval;
- `lowSpeedLimit`: `aws-c-http` TCP connection speed monitoring;
- `requestTimeoutMs`: to provide upper bound on the monitoring interval for `aws-c-http` TCP connection speed monitoring.
jmklix pushed a commit to aws/aws-sdk-cpp that referenced this pull request Oct 25, 2022
Based on awslabs/aws-c-s3#204, this exposes the following
`ClientConfiguration` options to CRT:
- `connect_timeout_ms`: S3 socket connection timeout;
- `enableTcpKeepAlive`: enable TCP keep-alive probes;
- `tcpKeepAliveIntervalMs`: TCP keep-alive wait/probe interval;
- `lowSpeedLimit`: `aws-c-http` TCP connection speed monitoring;
- `requestTimeoutMs`: to provide upper bound on the monitoring interval for `aws-c-http` TCP connection speed monitoring.
jmklix added a commit to aws/aws-sdk-cpp that referenced this pull request Oct 28, 2022
* [aws-cpp-sdk-s3-crt]: Configure TCP connection-monitoring options

Based on awslabs/aws-c-s3#204, this exposes the following
`ClientConfiguration` options to CRT:
- `connect_timeout_ms`: S3 socket connection timeout;
- `enableTcpKeepAlive`: enable TCP keep-alive probes;
- `tcpKeepAliveIntervalMs`: TCP keep-alive wait/probe interval;
- `lowSpeedLimit`: `aws-c-http` TCP connection speed monitoring;
- `requestTimeoutMs`: to provide upper bound on the monitoring interval for `aws-c-http` TCP connection speed monitoring.

* Use stack-allocated rather than dynamically allocated variables

* add code gen

* use int instead of uint16_t and uint32_t

* use static_cast

* rework static cast

* add another static cast

* remove static cast and use unsigned long

Co-authored-by: Gerrit Renker <grenker@aurora.tech>
jmklix added a commit to aws/aws-sdk-cpp that referenced this pull request Nov 1, 2022
* [aws-cpp-sdk-s3-crt]: Configure TCP connection-monitoring options

Based on awslabs/aws-c-s3#204, this exposes the following
`ClientConfiguration` options to CRT:
- `connect_timeout_ms`: S3 socket connection timeout;
- `enableTcpKeepAlive`: enable TCP keep-alive probes;
- `tcpKeepAliveIntervalMs`: TCP keep-alive wait/probe interval;
- `lowSpeedLimit`: `aws-c-http` TCP connection speed monitoring;
- `requestTimeoutMs`: to provide upper bound on the monitoring interval for `aws-c-http` TCP connection speed monitoring.

* Use stack-allocated rather than dynamically allocated variables

* add code gen

* use int instead of uint16_t and uint32_t

* use static_cast

* rework static cast

* add another static cast

* remove static cast and use unsigned long

Co-authored-by: Gerrit Renker <grenker@aurora.tech>
jmklix added a commit to aws/aws-sdk-cpp that referenced this pull request Aug 11, 2023
* [aws-cpp-sdk-s3-crt]: Configure TCP connection-monitoring options

Based on awslabs/aws-c-s3#204, this exposes the following
`ClientConfiguration` options to CRT:
- `connect_timeout_ms`: S3 socket connection timeout;
- `enableTcpKeepAlive`: enable TCP keep-alive probes;
- `tcpKeepAliveIntervalMs`: TCP keep-alive wait/probe interval;
- `lowSpeedLimit`: `aws-c-http` TCP connection speed monitoring;
- `requestTimeoutMs`: to provide upper bound on the monitoring interval for `aws-c-http` TCP connection speed monitoring.

* Use stack-allocated rather than dynamically allocated variables

* add code gen

* use int instead of uint16_t and uint32_t

* use static_cast

* rework static cast

* add another static cast

* remove static cast and use unsigned long

Co-authored-by: Gerrit Renker <grenker@aurora.tech>
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.

None yet

4 participants