Skip to content

libutil: Make PosixSourceAccessor update mtime only when needed#14562

Merged
Ericson2314 merged 1 commit intomasterfrom
no-races-posix-source-accessor
Nov 14, 2025
Merged

libutil: Make PosixSourceAccessor update mtime only when needed#14562
Ericson2314 merged 1 commit intomasterfrom
no-races-posix-source-accessor

Conversation

@xokdvium
Copy link
Contributor

Motivation

Typically PosixSourceAccessor can be used from multiple threads, but mtime is not updated atomically (i.e. with compare_exchange_weak), so mtime gets raced. It's only needed in dumpPathAndGetMtime and mtime tracking can be gated behind that.

Also start using getLastModified interface instead of dynamic casts.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Typically PosixSourceAccessor can be used from multiple threads,
but mtime is not updated atomically (i.e. with compare_exchange_weak),
so mtime gets raced. It's only needed in dumpPathAndGetMtime and mtime
tracking can be gated behind that.

Also start using getLastModified interface instead of dynamic casts.
@xokdvium xokdvium requested a review from Ericson2314 November 13, 2025 22:03
@xokdvium xokdvium requested a review from edolstra as a code owner November 13, 2025 22:03
@Ericson2314 Ericson2314 added this pull request to the merge queue Nov 14, 2025
Merged via the queue into master with commit 94c3bb3 Nov 14, 2025
20 checks passed
@Ericson2314 Ericson2314 deleted the no-races-posix-source-accessor branch November 14, 2025 05:36
@edolstra edolstra mentioned this pull request Dec 9, 2025
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