Skip to content

ARSN-652: Fix leak in DataWrapper on KMS or stream error - #2715

Merged
bert-e merged 7 commits into
development/8.4from
improvement/ARSN-652-leak-kms
Oct 2, 2026
Merged

bert-e merged 7 commits into
development/8.4from
improvement/ARSN-652-leak-kms

Conversation

@BourgoisMickael

@BourgoisMickael BourgoisMickael commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

1st commit for prettier, otherwise changes are small


Destroy the data stream on backend error

  • destroy the get stream on get with KMS error
  • destroy the get stream on copy (for object and part)
    on both KMS or put error

Replace pipe with pipeline for cleanup
.pipe() only forwards data, backpressure and end.
pipeline forwards errors and destroy streams for cleanup and prevent socket leak.

Otherwise some socket might stay open for a while until garbage collection
if any issue arise anywhere in the pipeline.

Note: for _put value stream and error downstream is not propagated
this is by design to let the V4Transform drain the incoming HTTP upload stream


Tests pass in

@bert-e

bert-e commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Hello bourgoismickael,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval ⭐
/bypass_build_status Bypass the build and test status ⭐
/bypass_commit_size Bypass the check on the size of the changeset TBA ⭐
/bypass_incompatible_branch Bypass the check on the source branch prefix ⭐
/bypass_jira_check Bypass the Jira issue check ⭐
/bypass_peer_approval Bypass the pull request peers' approval ⭐
/bypass_leader_approval Bypass the pull request leaders' approval ⭐
/bypass_source_branch_lineage Bypass the cross-branch contamination check ⭐
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request.
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

Comment thread lib/storage/data/DataWrapper.js Outdated
@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.50246% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.72%. Comparing base (7d29c31) to head (9ff0079).

Files with missing lines Patch % Lines
lib/storage/data/DataWrapper.js 66.50% 68 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           development/8.4    #2715      +/-   ##
===================================================
+ Coverage            74.44%   74.72%   +0.27%     
===================================================
  Files                  229      229              
  Lines                18566    18582      +16     
  Branches              3811     3847      +36     
===================================================
+ Hits                 13822    13885      +63     
+ Misses                4739     4692      -47     
  Partials                 5        5              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@scality scality deleted a comment from bert-e Sep 29, 2026
@BourgoisMickael BourgoisMickael changed the title ARSN-652: Destroy the data stream on KMS error ARSN-652: Fix leak in DataWrapper on KMS or stream error Sep 30, 2026
@BourgoisMickael
BourgoisMickael force-pushed the improvement/ARSN-652-leak-kms branch from 3c5984c to f3c007c Compare October 2, 2026 04:35
Comment thread lib/storage/data/DataWrapper.js
- destroy the get stream on get with KMS error
- destroy the get stream on copy (for object and part)
  on both KMS or put error
@BourgoisMickael
BourgoisMickael force-pushed the improvement/ARSN-652-leak-kms branch from f3c007c to fe7a447 Compare October 2, 2026 04:40
@BourgoisMickael
BourgoisMickael requested review from a team, DarkIsDude, anurag4DSB, benzekrimaha, fredmnl and leif-scality and removed request for a team October 2, 2026 09:11

@anurag4DSB anurag4DSB left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a question about sequence of events we want to happen to not leave orphan threads. May be thats intentional

Comment thread lib/storage/data/DataWrapper.js Outdated
Comment thread lib/storage/data/DataWrapper.js
Comment thread lib/storage/data/DataWrapper.js
`.pipe()` only forwards data, backpressure and end.
`pipeline` forwards errors and destroy streams for cleanup and prevent socket leak.

Otherwise some socket might stay open for a while until garbage collection
if any issue arise anywhere in the pipeline.

Note: for _put value stream and error downstream is not propagated
this is by design to let the V4Transform drain the incoming HTTP upload stream
@BourgoisMickael
BourgoisMickael force-pushed the improvement/ARSN-652-leak-kms branch from fe7a447 to 9ff0079 Compare October 2, 2026 12:03
@scality scality deleted a comment from bert-e Oct 2, 2026
@scality scality deleted a comment from bert-e Oct 2, 2026
@bert-e

bert-e commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

@scality scality deleted a comment from bert-e Oct 2, 2026
@BourgoisMickael

Copy link
Copy Markdown
Contributor Author

/create_integration_branches

@bert-e

bert-e commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Conflict

A conflict has been raised during the creation of
integration branch w/8.5/improvement/ARSN-652-leak-kms with contents from improvement/ARSN-652-leak-kms
and development/8.5.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 git fetch
 git checkout -B w/8.5/improvement/ARSN-652-leak-kms origin/development/8.5
 git merge origin/improvement/ARSN-652-leak-kms
 # <intense conflict resolution>
 git commit
 git push -u origin w/8.5/improvement/ARSN-652-leak-kms

The following options are set: create_integration_branches

@bert-e

bert-e commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Conflict

A conflict has been raised during the creation of
integration branch w/8.6/improvement/ARSN-652-leak-kms with contents from w/8.5/improvement/ARSN-652-leak-kms
and development/8.6.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 git fetch
 git checkout -B w/8.6/improvement/ARSN-652-leak-kms origin/development/8.6
 git merge origin/w/8.5/improvement/ARSN-652-leak-kms
 # <intense conflict resolution>
 git commit
 git push -u origin w/8.6/improvement/ARSN-652-leak-kms

The following options are set: create_integration_branches

@bert-e

bert-e commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

The following options are set: create_integration_branches

@BourgoisMickael

Copy link
Copy Markdown
Contributor Author

/approve

@bert-e

bert-e commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/8.4

  • ✔️ development/8.5

  • ✔️ development/8.6

The following branches have NOT changed:

  • development/6.4
  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.1
  • development/8.2
  • development/8.3

This pull request did not target the following hotfix branch(es) so they
were left untouched:

  • hotfix/7.4.8
  • hotfix/7.10.57
  • hotfix/7.5.0
  • hotfix/7.10.0
  • hotfix/7.4.0
  • hotfix/6.4.7
  • hotfix/7.4.2
  • hotfix/7.10.29
  • hotfix/7.4.3
  • hotfix/7.9.0
  • hotfix/7.10.46
  • hotfix/7.8.0
  • hotfix/7.10.36
  • hotfix/7.4.9
  • hotfix/7.10.4
  • hotfix/7.10.3
  • hotfix/7.4.6
  • hotfix/7.70.4
  • hotfix/7.2.0
  • hotfix/7.4.4
  • hotfix/7.10.1
  • hotfix/7.10.2
  • hotfix/7.6.0
  • hotfix/7.70.25
  • hotfix/7.4.5
  • hotfix/7.70.14
  • hotfix/7.10.31
  • hotfix/7.7.0
  • hotfix/7.4.1
  • hotfix/7.4.7
  • hotfix/7.10.43
  • hotfix/7.4.10
  • hotfix/8.2.48
  • hotfix/7.70.20
  • hotfix/7.10.47

Please check the status of the associated issue ARSN-652.

Goodbye bourgoismickael.

The following options are set: approve, create_integration_branches

@bert-e
bert-e merged commit 9ff0079 into development/8.4 Oct 2, 2026
13 of 14 checks passed
@bert-e
bert-e deleted the improvement/ARSN-652-leak-kms branch October 2, 2026 12:57
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.

4 participants