Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Buildsystem] Prevent cache check mangling access time #99501

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

AThousandShips
Copy link
Member

Checking for text files using open changes atime, which breaks cache access sorting, this ensures the cache access time is preserved.

From looking at the code (without testing) this seems to be a regression from:

So shouldn't affect older versions but haven't tested explicitly there for access time issues

@AThousandShips AThousandShips added this to the 4.4 milestone Nov 21, 2024
@AThousandShips AThousandShips requested a review from a team as a code owner November 21, 2024 16:49
@AThousandShips
Copy link
Member Author

This could be replaced by having another way to handle the checking for text files, but I'm not aware of one. Couldn't find any way to use open or similar without updating atime, if there is that would be more useful here

@dustdfg
Copy link
Contributor

dustdfg commented Nov 21, 2024

This could be replaced by having another way to handle the checking for text files, but I'm not aware of one. Couldn't find any way to use open or similar without updating atime, if there is that would be more useful here

Myabe os.stat would work? You can then set atime with os.utime I've should look on changes before writing comment. sorry

@dustdfg
Copy link
Contributor

dustdfg commented Nov 21, 2024

And another question. Maybe cache should rely on mtime? Not on atime?

@AThousandShips
Copy link
Member Author

AThousandShips commented Nov 21, 2024

That's my solution? Or what do you mean? Please check the code

It shouldn't rely on mtime because then it'll ignore older, but more recently used, cache entries, cache entries that were read but not written to

Checking for text files using `open` changes `atime`, which breaks cache
access sorting, this ensures the cache access time is preserved.
@Repiteo Repiteo merged commit b25c7e3 into godotengine:master Nov 22, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 22, 2024

Thanks!

@AThousandShips AThousandShips deleted the fix_cache_time branch November 22, 2024 09:08
@AThousandShips
Copy link
Member Author

Thank you!

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.

3 participants