Skip to content

Conversation

@silverweed
Copy link
Contributor

The nbytes value returned by TDirectoryFile::Write() is only > 0 if we write at least one TObject to the file, which is not the case for non-TObject-based objects that handle their own writing (e.g. RNTuple through RMiniFile).
This means that if we write only non-TObjects in a TParallelMergingFile we will never call UploadAndReset() by only checking nbytes. With this PR, we instead use GetBytesWritten() to check if anything gets written by TDirectoryFile::Write(), which works even in case of non- TObjects.

cc @amete - this should fix one of the issues you observed with your parallel file merger when you only merge RNTuples.

The `nbytes` value returned by TDirectoryFile::Write() is only > 0 if
we write at least one TObject to the file, which is not the case for
non-TObject-based objects that handle their own writing (e.g. RNTuple
through RMiniFile).
This means that if we write only non-TObjects in a TParallelMergingFile
we will never call UploadAndReset() by only checking nbytes.
With this PR, we instead use GetBytesWritten() to check if anything gets
written by TDirectoryFile::Write(), which works even in case of non-
TObjects.
@github-actions
Copy link

Test Results

    21 files      21 suites   3d 10h 25m 16s ⏱️
 3 703 tests  3 703 ✅ 0 💤 0 ❌
76 155 runs  76 155 ✅ 0 💤 0 ❌

Results for commit 9194c07.

Copy link
Contributor

@jblomer jblomer left a comment

Choose a reason for hiding this comment

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

Nice catch! We should try to add a test for it.

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.

2 participants