Skip to content

INTEGRATION [PR#6121 > development/9.3] 🐛 use SUR date instead of the infostore one to have an update LastMod…#6135

Merged
bert-e merged 14 commits intodevelopment/9.3from
w/9.3/bugfix/CLDSRV-878/use-sur-date
Apr 2, 2026
Merged

INTEGRATION [PR#6121 > development/9.3] 🐛 use SUR date instead of the infostore one to have an update LastMod…#6135
bert-e merged 14 commits intodevelopment/9.3from
w/9.3/bugfix/CLDSRV-878/use-sur-date

Conversation

@bert-e
Copy link
Copy Markdown
Contributor

@bert-e bert-e commented Apr 2, 2026

This pull request has been created automatically.
It is linked to its parent pull request #6121.

Do not edit this pull request directly.
If you need to amend/cancel the changeset on branch
w/9.3/bugfix/CLDSRV-878/use-sur-date, please follow this
procedure:

 git fetch
 git checkout w/9.3/bugfix/CLDSRV-878/use-sur-date
 # <amend or cancel the changeset by _adding_ new commits>
 git push origin w/9.3/bugfix/CLDSRV-878/use-sur-date

Please always comment pull request #6121 instead of this one.

Call UtilizationService.getUtilizationMetrics for capacity.xml on the
HEAD and LIST routes, mirroring the existing pattern from GET. This
ensures Last-Modified is derived from SUR metrics (not stale metadata)
on all three routes. Fall back to new Date() when metrics are
unavailable (404) or absent. Also use new Date() as the fallback in
GET instead of the stored LastModified value.

Issue: CLDSRV-878
Move the shared UtilizationService call pattern (bucket key derivation,
404 warn/fallback, error logging) into a single fetchCapacityMetrics
helper in utils.js, used by GET, HEAD, and LIST routes.

Issue: CLDSRV-878
throw errors.InternalError;
}
} else {
bucketMetrics = { date: new Date() };
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For system.xml, bucketMetrics is set to { date: new Date() }, so modified is always the current time. The old code used the stored LastModified from metadata (the date when system.xml was last PUT). This means every GET/HEAD of system.xml now reports the current time as Last-Modified, which misrepresents when the file was actually modified and could break client-side caching.

Meanwhile, list.js still uses file.LastModified (the stored metadata date) for system.xml entries, creating an inconsistency between GET/HEAD and LIST responses for the same file.

Consider preserving the stored LastModified for system.xml by reading it from getFileToBuild before the LastModified field is deleted.

— Claude Code

* @returns {undefined} -
*/
function getVeeamFile(request, response, bucketMd, log) {
async function getVeeamFile(request, response, bucketMd, log) {
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 async route handlers (getVeeamFile, headVeeamFile, listVeeamFiles) now return promises, but the caller in routeVeeam.js:167 (return callback(request, response, bucketMd, log)) ignores the return value since it is inside the final callback of async.waterfall. If any handler throws an unhandled error (e.g. respondWithData throws before its internal try/catch, or responseXMLBody throws), the rejection is never caught, causing an unhandled promise rejection that crashes the Node.js process. Consider adding a .catch() guard in routeVeeam.js or wrapping the top-level of each async handler in a try/catch that covers all code paths.

— Claude Code

@claude
Copy link
Copy Markdown

claude bot commented Apr 2, 2026

  • Unhandled promise rejection risk: The async route handlers (get, head, list) are called from routeVeeam.js:167 inside an async.waterfall final callback that ignores the return value. Any uncaught error in the async handlers becomes an unhandled promise rejection that crashes the process. Add a .catch() guard in routeVeeam.js, or ensure each async handler has a top-level try/catch covering all code paths. Note that putVeeamFile is still callback-based, so the guard must handle both sync and async returns.
    • Add .catch(err => responseXMLBody(err, null, response, log)) on the callback call in routeVeeam.js:167
    • If doing so, also convert putVeeamFile to async or conditionally apply the .catch()
  • system.xml Last-Modified regression: buildVeeamFileData always uses new Date() for system.xml, discarding the stored metadata LastModified (the date when system.xml was last PUT). This changes GET/HEAD behavior for system.xml and creates an inconsistency with LIST, which still uses the stored date.
    • Preserve the stored LastModified for system.xml, or align LIST to also use new Date()

Review by Claude Code

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
8276 2 8274 0
View the top 2 failed test(s) by shortest run time
"after each" hook for "should copy an object and its additional headers if copy included as metadata directive header (and ignore any new headers sent with copy request)"::Object Copy With v4 signature "after each" hook for "should copy an object and its additional headers if copy included as metadata directive header (and ignore any new headers sent with copy request)"
Stack Traces | 0.002s run time
read ECONNRESET
"after all" hook for "should copy restored object and reset storage class"::Object Copy With v4 signature "after all" hook for "should copy restored object and reset storage class"
Stack Traces | 0.006s run time
The bucket you tried to delete is not empty.

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

@bert-e bert-e merged commit 0a8e82c into development/9.3 Apr 2, 2026
51 of 54 checks passed
@bert-e bert-e deleted the w/9.3/bugfix/CLDSRV-878/use-sur-date branch April 2, 2026 16:31
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.

2 participants