Skip to content

[io] use UUIDv4 in ROOT files#22035

Open
jblomer wants to merge 6 commits intoroot-project:masterfrom
jblomer:fix-uuid
Open

[io] use UUIDv4 in ROOT files#22035
jblomer wants to merge 6 commits intoroot-project:masterfrom
jblomer:fix-uuid

Conversation

@jblomer
Copy link
Copy Markdown
Contributor

@jblomer jblomer commented Apr 23, 2026

Use UUIDv4 in TDirectory (hence in TDirectoryFile and TFile) and in the RMiniFile. Note that TDirectory is used without gSystem (needed for GetCryptoRandom()) in the context of rootcling. In principle, GetCryptoRandom() should work without a TSystem object. That may be for a later PR.

The UUIDv4, unlike the current UUIDv1, is (with high enough probability) globally unique.

Also fixes a race in TUUID::AsString().

EDIT: The last two commits factor out the GetCryptoRandom() into a free function, so that it can be used unconditionally in the I/O.

Fixes #22015
Replaces #22016

Comment thread core/base/src/TDirectory.cxx Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Test Results

    22 files      22 suites   3d 15h 14m 18s ⏱️
 3 852 tests  3 850 ✅  1 💤 1 ❌
76 049 runs  76 030 ✅ 18 💤 1 ❌

For more details on these failures, see this check.

Results for commit ec0de0a.

♻️ This comment has been updated with latest results.

@dpiparo
Copy link
Copy Markdown
Member

dpiparo commented Apr 24, 2026

Impressive PR: thanks for it. It should be backported until 6.36.

Comment thread core/base/src/TUUID.cxx
Copy link
Copy Markdown
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

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

LGTM, let's wait for the CI. Just a minor consideration.

Comment thread core/base/src/RCryptoRandom.cxx
Comment thread core/base/src/TSystem.cxx Outdated
@jblomer jblomer requested a review from pcanal April 24, 2026 10:29
@jblomer jblomer force-pushed the fix-uuid branch 2 times, most recently from bad1286 to e92b612 Compare April 24, 2026 13:33
Comment thread core/base/inc/TSystem.h Outdated
Comment thread core/base/src/TUUID.cxx Outdated
Comment thread core/base/inc/TUUID.h Outdated
Copy link
Copy Markdown
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

jblomer added 5 commits April 24, 2026 21:32
Use UUIDv4 in TDirectory (hence in TDirectoryFile and TFile) and in the
RMiniFile. Note that TDirectory is used without gSystem (needed for
GetCryptoRandom()) in the context of rootcling.  In principle,
GetCryptoRandom() should work without a TSystem object.  That may be for
a later commit.

The UUIDv4, unlike the current UUIDv1, is (with high enough probability)
globally unique.
Factor out calling the OS crypto random number generator into a free
function in the Base package. In turn, TSystem::GetCryptoRandom() can be
static and does not rely in gSystem being initialized.
@jblomer
Copy link
Copy Markdown
Contributor Author

jblomer commented Apr 24, 2026

/backport to 6.40,6.38,6.36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non uniquess of the UUID inside TFile

6 participants