takano-akio / filelock Goto Github PK
View Code? Open in Web Editor NEWPortable interface to file locking
License: Creative Commons Zero v1.0 Universal
Portable interface to file locking
License: Creative Commons Zero v1.0 Universal
I adapted tests.hs
and provided directions to reproduce the problem in jmitchell@4a850dd.
Is there a different way I should secure a lock, write to the locked file, and then release the lock?
I suspect what's happening is some low-level write/close operation is attempting to lock as well and causing a FILE LOCK CONFLICT
. However, writing to a file without using System.FileLock
results in no LockFile
operations according to Process Monitor. This suggests low-level file writing/closing operations behavior varies depending on the existence of a lock, and inexplicably re-lock when there's already a lock.
It's possible System.FileLock
's upstream APIs broke this use case, or perhaps there's an issue with the LockFileEx wrapper.
I get this error locally with GHC 9.6.0, but it is also reproduced by the CI:
$ cabal test interrupt --test-show-details=direct
Build profile: -w ghc-9.6.0.20230128 -O1
In order, the following will be built (use -v for more details):
- filelock-0.1.1.5 (test:interrupt) (configuration changed)
...
Running 1 test suites...
Test suite interrupt: RUNNING...
interrupt: interrupt_test.lock: openFdAt: does not exist (No such file or directory)
Test suite interrupt: FAIL
This might be due to changes in the unix
package from 2.7
to 2.8
, but I don't know...
If lockFile
is waiting for the lock then it can't be interrupted with an async exception (killThread, System.Timeout.timeout, etc...).
Linking dist/build/test/test ...
> /tmp/stackage-build14/filelock-0.1.1.1$ dist/build/test/test
test: tests/lock.log.expected: openFile: does not exist (No such file or directory)
Citing from https://hydra.nixos.org/build/59842744/nixlog/1:
running tests
Running 1 test suites...
Test suite test: RUNNING...
log mismatch!
Test suite test: FAIL
To continue maintenance, I moved the package to https://github.com/haskell-pkg-janitors/filelock.
From now, please file issues and pull requests there.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.