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

Fix overly long mtime change delay calibration with HFS+. #4231

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

23Skidoo
Copy link
Member

Fixes #4230.

@mention-bot
Copy link

@23Skidoo, thanks for your PR! By analyzing the history of the files in this pull request, we identified @ezyang, @phadej and @sol to be potential reviewers.

@ezyang
Copy link
Contributor

ezyang commented Jan 13, 2017

What's the testing plan for this? Can we mock file system time interface? What happens if the resolution is 0.999s?

@23Skidoo
Copy link
Member Author

What's the testing plan for this? Can we mock file system time interface?

I can do this, but seems more trouble than it's worth. Maybe just ask @gracjan to test on his system?

What happens if the resolution is 0.999s?

We can change the check to mtime0 >= 1000000 || (1000000 - mtime0) <= 10000.

@ezyang
Copy link
Contributor

ezyang commented Jan 13, 2017

Legacy code is code without an automated test suite ;) But, we do have Mac OS X CI setup, so we could just test to make sure the calibration time doesn't take a wacky amount of time.

Isn't that a more reasonable metric? We don't want to spend too much time calibrating, so use that as the stopping point?

@23Skidoo
Copy link
Member Author

But, we do have Mac OS X CI setup, so we could just test to make sure the calibration time doesn't take a wacky amount of time.

OK, will do.

@ezyang
Copy link
Contributor

ezyang commented Jan 13, 2017

BTW, this is well worth solving; I bet we are chewing up a decent amount of time in our Mac OS X CI recalibrating here!

@23Skidoo
Copy link
Member Author

Added a test.

@23Skidoo 23Skidoo force-pushed the fix-hfs-mtime-resolution-calibration branch from fc96286 to d62d7c1 Compare January 13, 2017 12:17
@23Skidoo
Copy link
Member Author

@ezyang You were quite right, apparently my fix doesn't actually work on OS X. Will try increasing the epsilon and/or following @gracjan's suggestions.

@23Skidoo 23Skidoo force-pushed the fix-hfs-mtime-resolution-calibration branch 3 times, most recently from ac7a079 to 05aaaa5 Compare January 16, 2017 13:33
@23Skidoo
Copy link
Member Author

Increasing the epsilon to 0.1 s seems to do the trick... will now try @gracjan's suggestion.

@ezyang
Copy link
Contributor

ezyang commented Jan 22, 2017

Still failing Travis on OS X, it's real.

@gracjan
Copy link

gracjan commented Jan 23, 2017

The list of mtimes measured in the function looks like this:

*Distribution.Backpack Distribution.Compat.Time> calibrateMtimeChangeDelay 
[335264,994224,999491,1000088,999906,1000045,999953,1000012,999869,1001424,1003468,995152,999844,1000068,999953,1000066,1000889,998953,1003979,996114,1238135,761660,1000062,1006898,993069]
(1238135,1000000)

With bail-out after first measurement that gives 1s or more the list will be [335264, 994224, 999491, 1000088] and that is 3329067 (3.3s).

I'd like to make clear that '@gracjan's suggestion' is to measure file system resolution not clock resolution and that should take on average 0.5s on 1s resolution filesystem.

@23Skidoo 23Skidoo added this to the 2.0 milestone Feb 17, 2017
@23Skidoo 23Skidoo force-pushed the fix-hfs-mtime-resolution-calibration branch from 05aaaa5 to 9752f24 Compare May 5, 2017 08:27
@23Skidoo 23Skidoo modified the milestones: 2.0.1, 2.0 May 5, 2017
@23Skidoo
Copy link
Member Author

23Skidoo commented May 5, 2017

Remilestoned.

@23Skidoo 23Skidoo modified the milestones: 2.0.1, 2.0.2 Sep 19, 2017
@23Skidoo 23Skidoo modified the milestones: 2.0.2, 2.4 Aug 29, 2018
@23Skidoo 23Skidoo modified the milestones: 2.4, 2.4.1 Sep 17, 2018
@23Skidoo 23Skidoo modified the milestones: 2.4.1.0, 2.4.2.0 Apr 26, 2019
@phadej phadej modified the milestones: 2.4.2.0, 3.4 Nov 27, 2019
@mergify mergify bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Sep 1, 2022
@ulysses4ever ulysses4ever removed the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Sep 3, 2022
@Kleidukos
Copy link
Member

Marking this PR as draft 🙂

@Kleidukos Kleidukos marked this pull request as draft May 17, 2023 06:32
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.

calibrateMtimeChangeDelay takes 25s to execute on Mac OS X with HFS+ system
7 participants