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

don't cover the error code with retry failure #207

Merged
merged 2 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions source/s3_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,6 @@ void aws_s3_client_notify_connection_finished(
/* Ask the retry strategy to schedule a retry of the request. */
if (aws_retry_strategy_schedule_retry(
connection->retry_token, error_type, s_s3_client_retry_ready, connection)) {
error_code = aws_last_error_or_unknown();

AWS_LOGF_ERROR(
AWS_LS_S3_CLIENT,
Expand All @@ -1601,8 +1600,8 @@ void aws_s3_client_notify_connection_finished(
(void *)request,
(void *)meta_request,
(void *)connection->retry_token,
error_code,
aws_error_str(error_code));
aws_last_error_or_unknown(),
aws_error_str(aws_last_error_or_unknown()));

goto reset_connection;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/s3_retry_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ static void s_s3_client_acquire_http_connection_exceed_retries(
AWS_ASSERT(callback);
(void)conn_manager;

aws_raise_error(AWS_ERROR_UNKNOWN);
callback(NULL, AWS_ERROR_UNKNOWN, user_data);
aws_raise_error(AWS_ERROR_HTTP_UNKNOWN);
callback(NULL, AWS_ERROR_HTTP_UNKNOWN, user_data);
}

AWS_TEST_CASE(test_s3_client_exceed_retries, s_test_s3_client_exceed_retries)
Expand Down Expand Up @@ -56,7 +56,7 @@ static int s_test_s3_client_exceed_retries(struct aws_allocator *allocator, void
ASSERT_SUCCESS(aws_s3_tester_send_get_object_meta_request(
&tester, client, g_s3_path_get_object_test_1MB, 0, &meta_request_test_results));

ASSERT_TRUE(meta_request_test_results.finished_error_code == AWS_IO_MAX_RETRIES_EXCEEDED);
ASSERT_TRUE(meta_request_test_results.finished_error_code == AWS_ERROR_HTTP_UNKNOWN);

aws_s3_meta_request_test_results_clean_up(&meta_request_test_results);

Expand Down