Only clear the cache if there are no active writers.#7273
Merged
Conversation
In #6863 we discarded all jobs if synack isn't enabled for the pool. This fixed a severe memory leak which occurs on connection restart. Instead of going over each job and checking if we should discard it, we should clear the entire cache when there are no active writers. If there are active writers, we should discard the jobs from the cache after we're done writing them since they also may remain on the cache forever.
Codecov Report
@@ Coverage Diff @@
## master #7273 +/- ##
==========================================
+ Coverage 89.31% 91.01% +1.69%
==========================================
Files 138 138
Lines 16774 19637 +2863
Branches 2450 3384 +934
==========================================
+ Hits 14982 17872 +2890
+ Misses 1560 1525 -35
- Partials 232 240 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
auvipy
reviewed
Feb 1, 2022
Member
auvipy
left a comment
There was a problem hiding this comment.
should we try to add some tests or increase some test coverage?
auvipy
approved these changes
Aug 1, 2022
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #6863 we discarded all jobs if synack isn't enabled for the pool.
This fixed a severe memory leak which occurs on connection restart.
Instead of going over each job and checking if we should discard it, we should clear the entire cache when there are no active writers.
If there are active writers, we should discard the jobs from the cache after we're done writing them since they also may remain on the cache forever.
Note: Before submitting this pull request, please review our contributing
guidelines.
Description