HDFGroup / HDFGroup/hdf5

Use fcntl() when filesystem does not support flock().

Open
#3,311 0 comments 0 reactions 1 assignee Assigned to @fortnern View on GitHub
Component - C Library
Dominant language
C
Stars
988
Forks
355
Avg merge
4d 2h
Merged PRs (30d)
12

Description

When opening a file read-only on a "dvs" filesystem, HDF5 will complain that it cannot lock the file and it reports (among others):

#006: H5Fint.c line 1898 in H5F_open(): unable to lock the file
#007: H5FD.c line 1625 in H5FD_lock(): driver lock request failed
#008: H5FDsec2.c line 1002 in H5FD__sec2_lock(): unable to lock file, errno = 524, error message = 'Unknown error 524'

I found that error 524 corresponds to ENOTSUPP (Not supported). According to https://manualzz.com/doc/12737309/dvs-administration-guide#p39, using flock() on a "dvs" filesystem indeed is not supported and returns this error.

The dvs manual reports that locking using fcntl() is supported, so it would be nice if HDF5 would try using fcntl() when flock() returns ENOTSUPP.

As a workaround, I will disable locking using the HDF5_USE_FILE_LOCKING=FALSE environment variable for now. In my case, I only open the files in read-only mode so locks are not needed.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.