Skip to content

Commit 44b074f

Browse files
more comments
1 parent 4936f85 commit 44b074f

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

include/aws/s3/s3_buffer_pool.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ struct aws_s3_buffer_pool_reserve_meta {
4949
/* size of the buffer to reserve. */
5050
size_t size;
5151

52-
/* whether not granting the reservation can block. */
52+
/* whether not granting reservation can result in request pipeline being blocked.
53+
* Note: blocking is currently a terminal condition and that cannot be recovered from,
54+
* i.e. meta request will be stuck and not make any process.
55+
* As such buffer pool should either grant or error out reservation in sync.
56+
* This scenario currently only occurs in the async_write flows. */
5357
bool can_block;
5458
};
5559

source/s3_auto_ranged_put.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,6 @@ static bool s_s3_auto_ranged_put_update(
560560
}
561561

562562
if (should_create_next_part_request) {
563-
564-
AWS_LOGF_DEBUG(0, "Creating next part");
565-
566563
struct aws_s3_buffer_ticket *ticket = NULL;
567564
if (meta_request->synced_data.async_write.ready_to_send) {
568565
/* Async-write already has a ticket, take ownership */

source/s3_client.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,11 @@ struct aws_s3_client *aws_s3_client_new(
360360
}
361361

362362
struct aws_s3_buffer_pool_config buffer_pool_config = {
363-
.client = client, .part_size = part_size, .memory_limit = mem_limit, .max_part_size = max_part_size};
363+
.client = client,
364+
.part_size = part_size,
365+
.memory_limit = mem_limit,
366+
.max_part_size = max_part_size,
367+
};
364368

365369
if (client_config->buffer_pool_factory_fn) {
366370
client->buffer_pool = client_config->buffer_pool_factory_fn(allocator, buffer_pool_config);
@@ -1808,8 +1812,6 @@ static void s_s3_prepare_acquire_mem_callback_and_destroy(
18081812
struct aws_s3_meta_request *meta_request = payload->request->meta_request;
18091813
AWS_PRECONDITION(meta_request);
18101814

1811-
++payload->request->num_times_prepared;
1812-
18131815
if (error_code) {
18141816
AWS_LOGF_ERROR(
18151817
AWS_LS_S3_META_REQUEST,

tests/s3_data_plane_tests.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "aws/s3/private/s3_checksums.h"
77
#include "aws/s3/private/s3_client_impl.h"
8+
#include "aws/s3/private/s3_default_buffer_pool.h"
89
#include "aws/s3/private/s3_meta_request_impl.h"
910
#include "aws/s3/private/s3_util.h"
1011
#include "aws/s3/s3_client.h"
@@ -2323,17 +2324,17 @@ static int s_test_s3_put_object_buffer_pool_trim(struct aws_allocator *allocator
23232324

23242325
ASSERT_SUCCESS(aws_s3_tester_send_meta_request_with_options(&tester, &put_options, NULL));
23252326

2326-
/** TODO: */
2327-
/*struct aws_s3_buffer_pool_usage_stats usage_before = aws_s3_buffer_pool_get_usage(client->buffer_pool);
2327+
struct aws_s3_default_buffer_pool_usage_stats usage_before =
2328+
aws_s3_default_buffer_pool_get_usage((struct aws_s3_default_buffer_pool *)client->buffer_pool->impl);
23282329

23292330
ASSERT_TRUE(0 != usage_before.primary_num_blocks);
23302331

23312332
aws_thread_current_sleep(aws_timestamp_convert(6, AWS_TIMESTAMP_SECS, AWS_TIMESTAMP_NANOS, NULL));
23322333

2333-
struct aws_s3_buffer_pool_usage_stats usage_after = aws_s3_buffer_pool_get_usage(client->buffer_pool);
2334+
struct aws_s3_default_buffer_pool_usage_stats usage_after =
2335+
aws_s3_default_buffer_pool_get_usage(client->buffer_pool);
23342336

23352337
ASSERT_INT_EQUALS(0, usage_after.primary_num_blocks);
2336-
*/
23372338

23382339
client = aws_s3_client_release(client);
23392340

0 commit comments

Comments
 (0)