Skip to content

CLDSRV-1012: Backport KMS error and socket leak on DataWrapper - #6322

Merged
bert-e merged 4 commits into
development/7.10from
improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10
Oct 8, 2026
Merged

bert-e merged 4 commits into
development/7.10from
improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10

Conversation

@BourgoisMickael

@BourgoisMickael BourgoisMickael commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Integration test passing: https://github.com/scality/Integration/actions/runs/37098044524


(arsenal is not bumped in integration branches)

(cherry picked from commit 5184ec2)

Dropped monitoring, as it appeared only in 7.70 and not 7.10

This goes with scality/Arsenal#2720
For RD-2378
@bert-e

bert-e commented Oct 5, 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.

@bert-e

bert-e commented Oct 5, 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.

@BourgoisMickael BourgoisMickael changed the title CLDSRV-1012: Handle KMS before data to return error CLDSRV-1012: Handle KMS error and socket leak on DataWrapper Oct 5, 2026
@BourgoisMickael BourgoisMickael changed the title CLDSRV-1012: Handle KMS error and socket leak on DataWrapper CLDSRV-1012: Backport KMS error and socket leak on DataWrapper Oct 5, 2026
Comment thread lib/api/objectGet.js
return callback(err);
// Check KMS Key access and usability before checking data
// diff with AWS: for empty object (no dataLocator) KMS not checked
return async.each(dataLocator || [],

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.

nit/question: async.each fires one KMS call per location entry, all in parallel. For an MPU object with thousands of parts, that is thousands of concurrent requests to the KMS on a single GET. Could we use async.eachLimit with a small cap (5 or 10) so one big object cannot flood the KMS?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, and this has been shipped like that since more than 1 year in 9.5.0. This needs to be fixed in all versions.

I could even dedup the keys to avoid querying the same key multiple times as for MPU it's likely all parts use the same master key.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread lib/api/objectGet.js
});
},
err => {
if (err) {

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.

Question: if one part's createDecipherBundle fails here, or data.head fails just below, what happens to the decipher streams already attached to the other parts? Same question if the client goes away before streaming starts. As far as I can tell they are never consumed or destroyed. Is that harmless, or should we destroy any objectGetInfo.decipherStream already set on these error paths? It feels like the same kind of lifecycle gap the arsenal fix covers, but I may be missing where they get cleaned up.

Also, would it make sense to add a cloudserver unit test for "KMS error is returned before any data is read", for example with a stubbed kms.createDecipherBundle that returns an error? That seems to be the main behavior this backport is for.

@BourgoisMickael BourgoisMickael Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The current fix is related to an HTTP request keeping a socket to sproxyd.

The decipher stream has no socket to external service, it's a stream.Transform from crypto

const cipher = crypto.createDecipheriv(this._algorithm(), derivedKey, iv);

https://nodejs.org/api/crypto.html#cryptocreatedecipherivalgorithm-key-iv-options

It's in memory Transform with no socket involved. So it gets garbage collected.

JS memory is very light on Transform but that crypto does hold for OpenSSL some C++ native memory. So it would be better to clean them ASAP instead of waiting for GC or it might create native memory OOM in some conditions.


I'll likely open another PR / ticket to fix those 2 issues present in all versions of cloudserver out of this backport.


And I'll add some tests as well if they don't exist

Comment thread package.json Outdated
@francoisferrand
francoisferrand removed their request for review October 7, 2026 15:53
@BourgoisMickael
BourgoisMickael force-pushed the improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10 branch from bb3935e to a5b4c80 Compare October 8, 2026 02:18
@BourgoisMickael

Copy link
Copy Markdown
Contributor Author

/create_integration_branches

@bert-e

bert-e commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Conflict

A conflict has been raised during the creation of
integration branch w/7.70/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10 with contents from improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10
and development/7.70.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 git fetch
 git checkout -B w/7.70/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10 origin/development/7.70
 git merge origin/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10
 # <intense conflict resolution>
 git commit
 git push -u origin w/7.70/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10

The following options are set: create_integration_branches

@bert-e

bert-e commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Conflict

A conflict has been raised during the creation of
integration branch w/8.8/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10 with contents from w/7.70/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10
and development/8.8.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 git fetch
 git checkout -B w/8.8/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10 origin/development/8.8
 git merge origin/w/7.70/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10
 # <intense conflict resolution>
 git commit
 git push -u origin w/8.8/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10

The following options are set: create_integration_branches

@bert-e

bert-e commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Conflict

A conflict has been raised during the creation of
integration branch w/9.4/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10 with contents from w/9.3/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10
and development/9.4.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 git fetch
 git checkout -B w/9.4/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10 origin/development/9.4
 git merge origin/w/9.3/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10
 # <intense conflict resolution>
 git commit
 git push -u origin w/9.4/improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10

The following options are set: create_integration_branches

@bert-e

bert-e commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/7.4

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

The following options are set: create_integration_branches

@bert-e

bert-e commented Oct 8, 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 8, 2026

Copy link
Copy Markdown
Contributor

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/7.10

  • ✔️ development/7.70

  • ✔️ development/8.8

  • ✔️ development/9.0

  • ✔️ development/9.1

  • ✔️ development/9.2

  • ✔️ development/9.3

  • ✔️ development/9.4

  • ✔️ development/9.5

The following branches will NOT be impacted:

  • development/7.4

This pull request does not target the following hotfix branch(es) so they
will be left untouched:

  • hotfix/7.10.8
  • hotfix/7.6.0
  • hotfix/7.4.9
  • hotfix/7.70.11
  • hotfix/9.0.7
  • hotfix/7.10.49
  • hotfix/6.4.7
  • hotfix/7.10.2
  • hotfix/7.10.1
  • hotfix/7.10.30
  • hotfix/7.4.5
  • hotfix/7.4.8
  • hotfix/9.0.32
  • hotfix/7.10.4
  • hotfix/7.4.2
  • hotfix/7.4.4
  • hotfix/7.4.10
  • hotfix/7.70.51
  • hotfix/7.70.73
  • hotfix/7.4.7
  • hotfix/7.4.0
  • hotfix/7.4.1
  • hotfix/7.4.6
  • hotfix/7.70.45
  • hotfix/7.9.0
  • hotfix/7.2.0
  • hotfix/7.10.3
  • hotfix/8.8.45
  • hotfix/7.8.0
  • hotfix/7.10.28
  • hotfix/7.10.15
  • hotfix/7.7.0
  • hotfix/7.70.21
  • hotfix/9.3.13
  • hotfix/7.10.27
  • hotfix/9.2.36
  • hotfix/7.4.3
  • hotfix/9.2.24
  • hotfix/7.10.0

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve, create_integration_branches

@bert-e

bert-e commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

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

  • ✔️ development/7.10

  • ✔️ development/7.70

  • ✔️ development/8.8

  • ✔️ development/9.0

  • ✔️ development/9.1

  • ✔️ development/9.2

  • ✔️ development/9.3

  • ✔️ development/9.4

  • ✔️ development/9.5

The following branches have NOT changed:

  • development/7.4

Please check the status of the associated issue CLDSRV-1012.

Goodbye bourgoismickael.

@bert-e
bert-e merged commit a5b4c80 into development/7.10 Oct 8, 2026
20 checks passed
@bert-e
bert-e deleted the improvement/CLDSRV-1012-bump-arsenal-datawrapper-7.10 branch October 8, 2026 17:50
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.

5 participants