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

Ant: fix GeneratedFilesHelper CRC cache #8190

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

mbien
Copy link
Member

@mbien mbien commented Jan 25, 2025

Cache used the xor function of timestamp and size as modification indicator for a CRC cache. This produced frequent collisions esp when timestamp and size were close together between two modifications.

example: write to a file 3 ms apart which added 5 bytes:

1737766006001L ^ 208
1737766006004L ^ 213

produces the same value -> thinks there was no modification -> returns old/wrong CRC value

fix: store both values without combiner function

fixes the first item on #8183

edit: emilianbold/netbeans-releases@fe56d24 close to 21 years old - might be new personal record after #7951 (comment) :).

@mbien mbien added tests Ant [ci] enable "build tools" tests labels Jan 25, 2025
@mbien mbien added this to the NB26 milestone Jan 25, 2025
@mbien mbien added the CI continuous integration changes label Jan 25, 2025
@mbien mbien requested a review from jglick January 25, 2025 18:28
Copy link
Contributor

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Looks right. Congratulations!

@mbien
Copy link
Member Author

mbien commented Feb 2, 2025

thanks for review, planning to merge this after rc2 synced back to master, since this stabilizes CI a bit

Cache used the xor function of timestamp and size as modification
indicator for a CRC cache. This produced frequent collisions esp when
timestamp and size were close together between two modifications.

example write to a file 3 ms apart which adds 5 bytes:
1737766006001L ^ 208
1737766006004L ^ 213
produces the same value -> thinks there was no modification

fix: store both values without combiner function
@mbien mbien force-pushed the fix-ant-fileshelper-crc-cache branch from fe97dec to 286e958 Compare February 7, 2025 15:42
@mbien mbien merged commit 868e71f into apache:master Feb 7, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ant [ci] enable "build tools" tests CI continuous integration changes tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants