Closed Helflym closed 4 years ago
I plan to do a review of this with the intent to merge it. One concern I have is that without an AIX test environment, we can't be confident in our implementation when making future changes. I'm doing some research on that, but not looking promising. 😄
I'm not sure there is any "free" AIX which can be used for testing.
My aim is just to provide a "first port" hoping AIX users will get use to it and will fix it if anything ever go wrong.
Note that Solaris, according to cmd/go/internal/lockedfile/internal/filelock/filelock_fcntl.go
should also use this fcntl
version instead of flock
version.
Hi Theckman,
Any news about this PR ? Have you find any way to make tests on an AIX machine ?
Hi Theckman,
Any news about this PR ? gofrs/flock is used in many others projects like Beats software and at the moment, we have to manually update "vendor" folder if we want to build them. I know that you can't test any future modifications on an AIX environment by yourself but I suppose letting the AIX community fixing it if it ever goes wrong is a viable solution
@bcmills / @theckman Any update on this? We'd like this get this merged if possible. @Helflym should still be available but I can take over development if needed.
@fearful-symmetry, I'm not in the gofrs
organization. My involvement in this PR is purely as the maintainer of a Go package with similar functionality (namely, cmd/go/internal/lockedfile
; see also golang/go#33974).
@bcmills anyone I should ping about getting this updated/approved?
@Helflym @fearful-symmetry @bcmills apologies, my hesitation has been that there are zero AIX build resources available for the community and it looked prohibitively expensive to try and learn AIX / gain access to one.
Yeah, it's not really possible. IBM doesn't provide free AIX VM for OpenSource developers... As I said for other Go packages, the AIX community should report if anything go wrong and should be able to fix it. Anyway, you can tag me if you want some tests on AIX.
At this point I'm okay ignoring that discomfort and merging this in for the benefit of the community, but there is a blocker in getting this merged. There were some changes released in v0.7.2 (#43) that need to be included here and tested on an AIX system.
Is there someone with access to AIX hardware that can develop / test that change?
I've made the change it and the tests are all OK.
@Helflym thank you! I'll work to get v0.8.0 out within the next 10-15 minutes.
AIX doesn't provide a true flock() syscall. It does exist but it's just
a wrapper around fcntl. It doesn't provide safe locks under file
descriptors of a same process.
The current implementation is based on the file
cmd/go/internal/lockedfile/internal/filelock/filelock_fcntl.go.
Using fcntl implementation doesn't allow to have several RLocks at the
same time as closing a file descriptor might release the lock if even
others RLocks remain attached.
AIX doesn't provide a true flock() syscall. It does exist but it's just a wrapper around fcntl. It doesn't provide safe locks under file descriptors of a same process.
The current implementation is based on the file cmd/go/internal/lockedfile/internal/filelock/filelock_fcntl.go.
Using fcntl implementation doesn't allow to have several RLocks at the same time as closing a file descriptor might release the lock if even others RLocks remain attached.