Skip to content

Commit

Permalink
[s3_client]: retry on failed TLS negotiation
Browse files Browse the repository at this point in the history
Failed TLS negotiation happens more often than expected, and it is a recoverable error.
Hence retry it.

Resolves #477.
  • Loading branch information
grrtrr committed Dec 14, 2024
1 parent 21a4ab4 commit e847f7f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source/s3_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2108,12 +2108,11 @@ static void s_s3_client_on_acquire_http_connection(
error_code,
aws_error_str(error_code));

if (error_code == AWS_IO_DNS_INVALID_NAME || error_code == AWS_IO_TLS_ERROR_NEGOTIATION_FAILURE ||
if (error_code == AWS_IO_DNS_INVALID_NAME ||
error_code == AWS_ERROR_PLATFORM_NOT_SUPPORTED || error_code == AWS_IO_SOCKET_INVALID_OPTIONS) {
/**
* Fall fast without retry
* Fail fast without retry
* - Invalid DNS name will not change after retry.
* - TLS negotiation is expensive and retry will not help in most case.
*/
AWS_LOGF_ERROR(
AWS_LS_S3_META_REQUEST,
Expand Down

0 comments on commit e847f7f

Please sign in to comment.