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

Fix MemoryLimit primary_allocated stat #453

Merged
merged 2 commits into from
Sep 18, 2024
Merged

Fix MemoryLimit primary_allocated stat #453

merged 2 commits into from
Sep 18, 2024

Conversation

waahm7
Copy link
Contributor

@waahm7 waahm7 commented Sep 18, 2024

Description of changes:

  • We never decrement the primary_used stat, which leads to incorrect reporting of an ever-increasing number.

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

@waahm7 waahm7 changed the title Fix MemoryLimit primary_used stat Fix MemoryLimit primary_allocated stat Sep 18, 2024
@@ -232,6 +232,7 @@ void s_buffer_pool_trim_synced(struct aws_s3_buffer_pool *buffer_pool) {
aws_array_list_get_at_ptr(&buffer_pool->blocks, (void **)&block, i);

if (block->alloc_bit_mask == 0) {
buffer_pool->primary_allocated -= block->block_size;
Copy link
Contributor

@DmitriyMusatkin DmitriyMusatkin Sep 18, 2024

Choose a reason for hiding this comment

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

can you check if we have same bug in secondary allocated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.31%. Comparing base (64c35be) to head (ed06a88).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #453      +/-   ##
==========================================
+ Coverage   89.29%   89.31%   +0.01%     
==========================================
  Files          20       20              
  Lines        6127     6128       +1     
==========================================
+ Hits         5471     5473       +2     
+ Misses        656      655       -1     
Files with missing lines Coverage Δ
source/s3_buffer_pool.c 97.19% <100.00%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes

@waahm7 waahm7 merged commit aede1d8 into main Sep 18, 2024
31 checks passed
@waahm7 waahm7 deleted the memlimit-issue branch September 18, 2024 21:47
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.

3 participants