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 inaccurate creation order on Windows #346

Merged
merged 2 commits into from
Apr 15, 2024
Merged

Conversation

mattjala
Copy link
Contributor

On Windows, time.time() has a low resolution (~16ms), so objects created in sequence sometimes have the same 'created' timestamp.

Creation time is now computed by adding the precise time elapsed since node startup (from time.perf_counter) to the recorded unix time at node startup, in the new helper timeUtil.getNow().

Fixes #344

@mattjala mattjala added the bug label Apr 12, 2024
@mattjala mattjala requested a review from jreadey April 12, 2024 14:47
@mattjala mattjala self-assigned this Apr 12, 2024
@mattjala mattjala changed the title Time fix Fix inaccurate creation order on Windows Apr 12, 2024
Copy link
Member

@jreadey jreadey left a comment

Choose a reason for hiding this comment

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

This looks good.
Potentially there is still an issue comparing timestamps set by different nodes (say the creation time of two different datasets). If they are instantiated on different DNs then there's no guarantee the time values correlate with the actions of the client. But since this only comes up in link creation comparisons where the links are on a single object it should be fine.

@mattjala mattjala merged commit 2a9ca0a into HDFGroup:master Apr 15, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creation timestamps lack resolution on Windows
2 participants