fix(mutate): close layer readers immediately after extracting layer#2190
fix(mutate): close layer readers immediately after extracting layer#2190caxu-rh wants to merge 2 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
16c6930 to
9746947
Compare
|
Sorry for the delay - resolved the CLA coverage. The diff looks kind of confusing, but this is essentially nesting the loop body into an anonymous function. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2190 +/- ##
===========================================
- Coverage 71.67% 52.93% -18.75%
===========================================
Files 123 165 +42
Lines 9935 11211 +1276
===========================================
- Hits 7121 5934 -1187
- Misses 2115 4562 +2447
- Partials 699 715 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
In mutate.extract, the closing of layerReader resources is deferred from inside a `for` loop. As a result, the layerReaders are left open until all layers are processed, which may accumulate on images with many layers. Intorduce an inner function/closure to contain the layerReader and operations that use it, so that it can be released immediately after the current layer has been processed. Signed-off-by: Caleb Xu <caxu@redhat.com>
9746947 to
72938b5
Compare
In mutate.extract, the closing of layerReader resources is deferred from inside a
forloop. As a result, the layerReaders are left open until all layers are processed, which may accumulate on images with many layers.Intorduce an inner function/closure to contain the layerReader and operations that use it, so that it can be released immediately after the current layer has been processed.