Skip to content

[main] Add --abort-on-failure flag to rootcp and some sanity checks#22555

Open
silverweed wants to merge 2 commits into
root-project:masterfrom
silverweed:rootcp_strict
Open

[main] Add --abort-on-failure flag to rootcp and some sanity checks#22555
silverweed wants to merge 2 commits into
root-project:masterfrom
silverweed:rootcp_strict

Conversation

@silverweed

Copy link
Copy Markdown
Contributor

Adding the option to abort the entire copy if any object fails to be copied.

@silverweed silverweed requested a review from jblomer June 10, 2026 07:05
@silverweed silverweed self-assigned this Jun 10, 2026
@silverweed silverweed requested a review from pcanal as a code owner June 10, 2026 07:05

@vepadulano vepadulano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like the idea! I left a couple of minor suggestions, also a test would be nice to have.

Comment thread main/src/rootcp.cxx Outdated
Comment thread main/src/rootcp.cxx Outdated

@vepadulano vepadulano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 13h 23m 36s ⏱️
 3 864 tests  3 862 ✅ 0 💤 2 ❌
76 324 runs  76 322 ✅ 0 💤 2 ❌

For more details on these failures, see this check.

Results for commit d87406c.

♻️ This comment has been updated with latest results.

Comment thread main/src/rootcp.cxx Outdated
Comment on lines +423 to +428
if (args_.fStrict) {
Err() << "node failed to be copied. Aborting.\n";
return false;
} else {
Warn() << "node will be skipped. Use --abort-on-failure if you want to abort on failure.\n";
return true;

@pcanal pcanal Jun 11, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are we guaranteed an error message from CopyNode that identify the failed node? (Other wise consider adding an identifier to the Error/Warning).

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.

Yes, every return false; in CopyNode is accompanied by an error/warning with the specifics

Comment thread main/src/rootcp.cxx
--recreate recreate the destination file.
-r, --recursive recurse inside directories
--replace replace object if already existing
-a, --abort-on-failure abort if any object fails to be copied (instead of skipping such objects)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does the output get deleted or is there an incomplete file left? (Should the choice between the two be left to the user?)

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.

Good point, it currently does not get removed but it probably should. I don't think we should add a flag to tweak that.

@silverweed silverweed changed the title [main] Add --strict flag to rootcp and some sanity checks [main] Add --abort-on-failure flag to rootcp and some sanity checks Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants