Skip to content

CLDSRV-1043: Fail KMS requests that exceed a time limit - #6358

Merged
bert-e merged 3 commits into
development/9.6from
improvement/CLDSRV-1043-fail-kms-requests-over-time-limit
Nov 23, 2026
Merged

bert-e merged 3 commits into
development/9.6from
improvement/CLDSRV-1043-fail-kms-requests-over-time-limit

Conversation

@dvasilas

@dvasilas dvasilas commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

KMIP and AWS KMS requests have no time limit: a request to a KMS that doesn't respond keeps its caller waiting indefinitely.

This PR adds a timeout to each attempt to a kmip or aws_kms KMS.
A request over the limit fails with a 500 error.

@bert-e

bert-e commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Hello dvasilas,

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 Nov 9, 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

@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

❌ 7 Tests Failed:

Tests completed Failed Passed Skipped
19460 7 19453 988
View the top 3 failed test(s) by shortest run time
Multipart Upload API with AWS Backend::should initiate a multipart upload on AWS location with bucketMatch equals false
Stack Traces | 0.093s run time
done() called multiple times in test <Multipart Upload API with AWS Backend should initiate a multipart upload on AWS location with bucketMatch equals false> of file .../tests/multipleBackend/multipartUpload.js; in addition, done() received error: Error: Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
    at createTimeoutError (file:.../mocha/lib/errors.js:329:15)
    at Test._timeoutError (file:.../mocha/lib/runnable.js:429:12)
    at Timeout._onTimeout (file:.../mocha/lib/runnable.js:240:26)
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7) {
  code: 'ERR_MOCHA_TIMEOUT',
  timeout: 90000,
  file: '.../tests/multipleBackend/multipartUpload.js'
}
Error: done() called multiple times in test <Multipart Upload API with AWS Backend should initiate a multipart upload on AWS location with bucketMatch equals false> of file .../tests/multipleBackend/multipartUpload.js; in addition, done() received error: Error: Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7) {
  code: 'ERR_MOCHA_TIMEOUT',
  timeout: 90000,
  file: '.../tests/multipleBackend/multipartUpload.js'
}
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7)
Multipart Upload API with AWS Backend::should initiate a multipart upload with tags on AWS
Stack Traces | 0.102s run time
done() called multiple times in test <Multipart Upload API with AWS Backend should initiate a multipart upload with tags on AWS> of file .../tests/multipleBackend/multipartUpload.js; in addition, done() received error: Error: Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
    at createTimeoutError (file:.../mocha/lib/errors.js:329:15)
    at Test._timeoutError (file:.../mocha/lib/runnable.js:429:12)
    at Timeout._onTimeout (file:.../mocha/lib/runnable.js:240:26)
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7) {
  code: 'ERR_MOCHA_TIMEOUT',
  timeout: 90000,
  file: '.../tests/multipleBackend/multipartUpload.js'
}
Error: done() called multiple times in test <Multipart Upload API with AWS Backend should initiate a multipart upload with tags on AWS> of file .../tests/multipleBackend/multipartUpload.js; in addition, done() received error: Error: Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7) {
  code: 'ERR_MOCHA_TIMEOUT',
  timeout: 90000,
  file: '.../tests/multipleBackend/multipartUpload.js'
}
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7)
Multipart Upload API with AWS Backend::should initiate a multipart upload on real AWS
Stack Traces | 0.128s run time
done() called multiple times in test <Multipart Upload API with AWS Backend should initiate a multipart upload on real AWS> of file .../tests/multipleBackend/multipartUpload.js; in addition, done() received error: Error: Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
    at createTimeoutError (file:.../mocha/lib/errors.js:329:15)
    at Test._timeoutError (file:.../mocha/lib/runnable.js:429:12)
    at Timeout._onTimeout (file:.../mocha/lib/runnable.js:240:26)
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7) {
  code: 'ERR_MOCHA_TIMEOUT',
  timeout: 90000,
  file: '.../tests/multipleBackend/multipartUpload.js'
}
Error: done() called multiple times in test <Multipart Upload API with AWS Backend should initiate a multipart upload on real AWS> of file .../tests/multipleBackend/multipartUpload.js; in addition, done() received error: Error: Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7) {
  code: 'ERR_MOCHA_TIMEOUT',
  timeout: 90000,
  file: '.../tests/multipleBackend/multipartUpload.js'
}
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7)
Multipart Upload API with AWS Backend::should only return number of parts equal to specified maxParts
Stack Traces | 0.366s run time
done() called multiple times in test <Multipart Upload API with AWS Backend should only return number of parts equal to specified maxParts> of file .../tests/multipleBackend/multipartUpload.js; in addition, done() received error: Error: Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
    at createTimeoutError (file:.../mocha/lib/errors.js:329:15)
    at Test._timeoutError (file:.../mocha/lib/runnable.js:429:12)
    at Timeout._onTimeout (file:.../mocha/lib/runnable.js:240:26)
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7) {
  code: 'ERR_MOCHA_TIMEOUT',
  timeout: 90000,
  file: '.../tests/multipleBackend/multipartUpload.js'
}
Error: done() called multiple times in test <Multipart Upload API with AWS Backend should only return number of parts equal to specified maxParts> of file .../tests/multipleBackend/multipartUpload.js; in addition, done() received error: Error: Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7) {
  code: 'ERR_MOCHA_TIMEOUT',
  timeout: 90000,
  file: '.../tests/multipleBackend/multipartUpload.js'
}
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7)
Multipart Upload API with AWS Backend::should list the parts of a multipart upload on real AWS location with bucketMatch set to false
Stack Traces | 0.469s run time
done() called multiple times in test <Multipart Upload API with AWS Backend should list the parts of a multipart upload on real AWS location with bucketMatch set to false> of file .../tests/multipleBackend/multipartUpload.js; in addition, done() received error: Error: Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
    at createTimeoutError (file:.../mocha/lib/errors.js:329:15)
    at Test._timeoutError (file:.../mocha/lib/runnable.js:429:12)
    at Timeout._onTimeout (file:.../mocha/lib/runnable.js:240:26)
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7) {
  code: 'ERR_MOCHA_TIMEOUT',
  timeout: 90000,
  file: '.../tests/multipleBackend/multipartUpload.js'
}
Error: done() called multiple times in test <Multipart Upload API with AWS Backend should list the parts of a multipart upload on real AWS location with bucketMatch set to false> of file .../tests/multipleBackend/multipartUpload.js; in addition, done() received error: Error: Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7) {
  code: 'ERR_MOCHA_TIMEOUT',
  timeout: 90000,
  file: '.../tests/multipleBackend/multipartUpload.js'
}
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7)
Multipart Upload API with AWS Backend::should list the parts of a multipart upload on real AWS
Stack Traces | 0.497s run time
done() called multiple times in test <Multipart Upload API with AWS Backend should list the parts of a multipart upload on real AWS> of file .../tests/multipleBackend/multipartUpload.js; in addition, done() received error: Error: Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
    at createTimeoutError (file:.../mocha/lib/errors.js:329:15)
    at Test._timeoutError (file:.../mocha/lib/runnable.js:429:12)
    at Timeout._onTimeout (file:.../mocha/lib/runnable.js:240:26)
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7) {
  code: 'ERR_MOCHA_TIMEOUT',
  timeout: 90000,
  file: '.../tests/multipleBackend/multipartUpload.js'
}
Error: done() called multiple times in test <Multipart Upload API with AWS Backend should list the parts of a multipart upload on real AWS> of file .../tests/multipleBackend/multipartUpload.js; in addition, done() received error: Error: Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7) {
  code: 'ERR_MOCHA_TIMEOUT',
  timeout: 90000,
  file: '.../tests/multipleBackend/multipartUpload.js'
}
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7)
Multipart Upload API with AWS Backend::should return invalidPart error
Stack Traces | 90s run time
Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
Error: Timeout of 90000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../tests/multipleBackend/multipartUpload.js)
    at listOnTimeout (node:internal/timers:685:17)
    at process.processTimers (node:internal/timers:618:7)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Comment thread package.json Outdated
"@opentelemetry/instrumentation-ioredis": "~0.70.0",
"@opentelemetry/instrumentation-mongodb": "~0.75.0",
"@scality/arsenal": "^8.6.1",
"@scality/arsenal": "git+https://github.com/scality/Arsenal#574ed2041c4a963e0c30a73e64c21d3807e5c0c9",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Arsenal is pinned to a raw commit (574ed204…) instead of a release tag. Git-based deps must pin to a tag. Release the Arsenal change (8.6.3?) and pin to that version before merging.

@dvasilas
dvasilas force-pushed the improvement/CLDSRV-1043-fail-kms-requests-over-time-limit branch from 9917afd to f217abc Compare November 19, 2026 13:47
@dvasilas
dvasilas requested a review from a team November 19, 2026 16:20

@nicolas2bert nicolas2bert 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.

LGTM
On follow up caught by Claude:
The AWS SDK's requestTimeout counts from the start of the request until the response headers arrive, and then it stops. Once the headers are in, nothing limits reading the body.

So this case still hangs forever:

  • The KMS (or a proxy, or a network that drops packets) sends 200 OK and the headers.
  • Then it sends nothing more.
  • The S3 request waits forever, just like before the PR.

@dvasilas

dvasilas commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

LGTM On follow up caught by Claude: The AWS SDK's requestTimeout counts from the start of the request until the response headers arrive, and then it stops. Once the headers are in, nothing limits reading the body.

So this case still hangs forever:

  • The KMS (or a proxy, or a network that drops packets) sends 200 OK and the headers.
  • Then it sends nothing more.
  • The S3 request waits forever, just like before the PR.

I created a follow up ticket ARSN-684

@dvasilas

Copy link
Copy Markdown
Contributor Author

/create_integration_branches

@bert-e

bert-e commented Nov 23, 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

@dvasilas
dvasilas force-pushed the improvement/CLDSRV-1043-fail-kms-requests-over-time-limit branch from f217abc to bd20c73 Compare November 23, 2026 07:27
Comment thread yarn.lock Outdated
optionalDependencies:
ioctl "^2.0.2"

"@scality/arsenal@^8.6.0":

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The lockfile now installs two arsenal copies: utapi's ^8.6.0 still resolves to 8.6.1, while cloudserver gets 8.6.4. Before this bump, both ranges shared one entry. Point both ranges at 8.6.4 (for example "@scality/arsenal@^8.6.0", "@scality/arsenal@^8.6.4":) and drop the 8.6.1 block, or run npx yarn-deduplicate.

Set by requestTimeoutMs on a kmip or aws_kms entry, 5000 ms by default.
The KMIP functional job gets a KMS that accepts connections and never answers.
@dvasilas
dvasilas force-pushed the improvement/CLDSRV-1043-fail-kms-requests-over-time-limit branch from bd20c73 to a4f176a Compare November 23, 2026 07:31
Comment thread lib/Config.js
const defaultLocalCache = { host: '127.0.0.1', port: 6379 };

// Time limit of each attempt of a request to a kmip or aws_kms KMS
const defaultKmsRequestTimeoutMs = 5000;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This turns a time limit on for every existing kmip entry, and in arsenal 8.6.4 it counts time spent waiting for a pipeline slot (pipelineDepth, 8 by default). On a timeout, _dropConversation fails every in-flight and deferred request on that transport. So a burst that queues past 5 s against a slow but healthy KMIP server now fails many requests at once with a 500, where before they only waited. Consider leaving the limit off when requestTimeoutMs is unset, or at least note this behaviour change in the release notes.

@dvasilas

Copy link
Copy Markdown
Contributor Author

/approve

@bert-e

bert-e commented Nov 23, 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/9.6

The following branches will NOT be impacted:

  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.8
  • development/9.0
  • development/9.1
  • development/9.2
  • development/9.3
  • development/9.4
  • development/9.5

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

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

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 Nov 23, 2026

Copy link
Copy Markdown
Contributor

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

  • ✔️ development/9.6

The following branches have NOT changed:

  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.8
  • development/9.0
  • development/9.1
  • development/9.2
  • development/9.3
  • development/9.4
  • development/9.5

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

Goodbye dvasilas.

@bert-e
bert-e merged commit 2a7f066 into development/9.6 Nov 23, 2026
36 of 37 checks passed
@bert-e
bert-e deleted the improvement/CLDSRV-1043-fail-kms-requests-over-time-limit branch November 23, 2026 08:04
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