Skip to content

Commit

Permalink
error rename
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Dec 4, 2023
1 parent 2d1dc27 commit 425c34e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/aws/s3/s3.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ enum aws_s3_errors {
AWS_ERROR_S3_FILE_MODIFIED,
AWS_ERROR_S3_EXCEEDS_MEMORY_LIMIT,
AWS_ERROR_S3_INVALID_MEMORY_LIMIT_CONFIG,
AWS_ERROR_S3_PART_SIZE_MISMATCH,
AWS_ERROR_S3_GET_PART_SIZE_MISMATCH,
AWS_ERROR_S3_END_RANGE = AWS_ERROR_ENUM_END_RANGE(AWS_C_S3_PACKAGE_ID)
};

Expand Down
2 changes: 1 addition & 1 deletion source/s3.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static struct aws_error_info s_errors[] = {
AWS_DEFINE_ERROR_INFO_S3(AWS_ERROR_S3_EXCEEDS_MEMORY_LIMIT, "Request was not created due to used memory exceeding memory limit."),
AWS_DEFINE_ERROR_INFO_S3(AWS_ERROR_S3_INVALID_MEMORY_LIMIT_CONFIG, "Specified memory configuration is invalid for the system. "
"Memory limit should be at least 1GiB. Part size and max part size should be smaller than memory limit."),
AWS_DEFINE_ERROR_INFO_S3(AWS_ERROR_S3_PART_SIZE_MISMATCH, "Request body length is not equal to the part_size."),
AWS_DEFINE_ERROR_INFO_S3(AWS_ERROR_S3_GET_PART_SIZE_MISMATCH, "Request body length is not equal to the part_size."),
};
/* clang-format on */

Expand Down
4 changes: 2 additions & 2 deletions source/s3_auto_ranged_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ static int s_discover_object_range_and_content_length(
case AWS_S3_AUTO_RANGE_GET_REQUEST_TYPE_GET_PART_NUMBER:
AWS_ASSERT(request->part_number == 1);

if (error_code != AWS_ERROR_SUCCESS && error_code != AWS_ERROR_S3_PART_SIZE_MISMATCH) {
if (error_code != AWS_ERROR_SUCCESS && error_code != AWS_ERROR_S3_GET_PART_SIZE_MISMATCH) {
/* If we hit an empty file while trying to discover the object-size via part, then this request
failure
* is as designed. */
Expand Down Expand Up @@ -720,7 +720,7 @@ static void s_s3_auto_ranged_get_request_finished(
case AWS_S3_AUTO_RANGE_GET_REQUEST_TYPE_GET_PART_NUMBER:
auto_ranged_get->synced_data.get_first_part_completed = true;
AWS_LOGF_DEBUG(AWS_LS_S3_META_REQUEST, "id=%p Get Part Number completed.", (void *)meta_request);
if (error_code == AWS_ERROR_S3_PART_SIZE_MISMATCH && found_object_size) {
if (error_code == AWS_ERROR_S3_GET_PART_SIZE_MISMATCH && found_object_size) {
/* Try to fetch the first part again as a ranged get */
break;
}
Expand Down
4 changes: 2 additions & 2 deletions source/s3_meta_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ static int s_s3_meta_request_headers_block_done(
if (content_length > meta_request->part_size ||
(content_length < meta_request->part_size &&
aws_http_headers_has(request->send_data.response_headers, g_mp_parts_count_header_name))) {
return aws_raise_error(AWS_ERROR_S3_PART_SIZE_MISMATCH);
return aws_raise_error(AWS_ERROR_S3_GET_PART_SIZE_MISMATCH);
}
}
}
Expand Down Expand Up @@ -1539,7 +1539,7 @@ void aws_s3_meta_request_send_request_finish_default(
/* If the request failed due to an invalid (ie: unrecoverable) response status, or the meta request already
* has a result, then make sure that this request isn't retried. */
// TODO: expected error, don't log at error
if (error_code == AWS_ERROR_S3_INVALID_RESPONSE_STATUS || error_code == AWS_ERROR_S3_PART_SIZE_MISMATCH ||
if (error_code == AWS_ERROR_S3_INVALID_RESPONSE_STATUS || error_code == AWS_ERROR_S3_GET_PART_SIZE_MISMATCH ||
error_code == AWS_ERROR_S3_NON_RECOVERABLE_ASYNC_ERROR || meta_request_finishing) {
finish_code = AWS_S3_CONNECTION_FINISH_CODE_FAILED;

Expand Down
3 changes: 0 additions & 3 deletions tests/s3_data_plane_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -3742,8 +3742,6 @@ static int s_test_s3_download_multi_part_file_with_checksum(struct aws_allocator

/*** GET FILE with part_size > first_part_size ***/
client_options.part_size = MB_TO_BYTES(7);
// TODO: Discuss this case where partSize > fileSize
// client_options.part_size = MB_TO_BYTES(20);

ASSERT_SUCCESS(aws_s3_tester_client_new(&tester, &client_options, &client));
get_options.client = client;
Expand All @@ -3753,7 +3751,6 @@ static int s_test_s3_download_multi_part_file_with_checksum(struct aws_allocator

/*** GET FILE with part_size = first_part_size ***/
client_options.part_size = MB_TO_BYTES(5);
// client_options.part_size = MB_TO_BYTES(10);

ASSERT_SUCCESS(aws_s3_tester_client_new(&tester, &client_options, &client));
get_options.client = client;
Expand Down

0 comments on commit 425c34e

Please sign in to comment.