HDFGroup/hsds

Creation timestamps lack resolution on Windows

mattjala opened this issue · 2 comments

time.time() is used to get the current time when creating a link or other object. This works fine on POSIX systems, but on Windows only has a precision of about ~16ms. This means that two subsequently created objects can have the same creation time. Sorting links by creation order no longer consistently returns the link that was actually created first.

This issue shows up when testing H5Lget_link_name_by_idx through the REST VOL on Windows - see here.

We could potentially use an external library for getting the UNIX time to have enough precision on all systems.

What does the HDF5 library do on Windows?

The library tries to use more precise time functions (clock_gettime, gettimeofday) before falling back to time.

I'm working on a PR which uses time.perf_counter() to make sure subsequent calls have different timestamps