Comments (5)
It's a technicality, there's no way in the library we use to delete that file and I showed why it's not a good idea in our case. If you're supposed to run exactly one instance of software and it holds the lock during the entire run time then I think it might be deleted safely on exit. But people run multiple regolancer instances, up to 40 in parallel, so deleting the lock might cause unexpected race conditions this lock should prevent exactly.
from regolancer.
See gofrs/flock#41. I suppose it's unsafe to delete lock files in general if we expect many processes to run in parallel. Consider this situation:
- process1 acquires the lock for writing
- process2 tries to do the same but is blocked because of process1
- process1 finishes the work, unlocks the file
- process2 quickly locks it to itself
- process1 doesn't know that, deletes the file and exits (here it would fail on Windows but not on *nix)
- process3 attempts to acquire the lock, the file doesn't exist so it creates and locks a new one with the same name
- process2 still uses the (now deleted) lock
- process3 also uses the lock because it created a different file with the same name
And here we have process2 and process3 using the "exclusive" lock together at the same time.
from regolancer.
But this means, that I have to delete the lock by myself before starting a new run? Otherwise, I think, no process can write in the db.
from regolancer.
Have you tried just running the program? I never deleted the lock and it all worked fine even when I ran 3-4 processes at once. The mere presence of that file doesn't mean it's locked, flock
is a special syscall (see man 2 flock
) which places a lock on an existing file or blocks if it's already present. That's why we use a library for this and not simply create/check for an empty file, this stuff isn't cross platform and needs explicit support with platform API.
Oh, and also we don't have a db except the optional CSV stat file. It's currently not protected by the lock but it will be soon. If you mean the node cache, it's also not a db but a gob
dump and it's only written when the program terminates. This is protected by the lock.
from regolancer.
The program seems to work. But sometimes there is a difference between what you see and what happens.
But I am not so deep in the technical details. I was just wondering because the file existis and worried that there is still something locked. And yes I mean the node cache.
from regolancer.
Related Issues (20)
- Fee-Limit-PPM also for econ-handle HOT 3
- exclude nodes , weird behavior HOT 2
- [enhancement-request] automated rebalancing based on forwards HOT 3
- [feature] Learning about failures between channels HOT 7
- Deprecating allow-unbalance HOT 5
- [Request] Add absoluteto (ato) and absolutefrom (afrom) HOT 5
- Channel candidate selection issue in getChannelCandidates HOT 2
- [Feature] Show all parameters and selected channels HOT 2
- Return value on failure HOT 1
- Failing rapid rebalance HOT 3
- Question about --lost-profit HOT 2
- Accelerator for rapid-rebalance HOT 2
- add parameter to exclude channels by age HOT 9
- Feature Proposal: Running until all channels are rebalanced HOT 1
- Relative amounts cannot be included in the json config HOT 3
- Have `econ-ratio-max-ppm ` account for source channel fee rate as well, when `--lost-profit` is enables HOT 3
- Feature request: Limitation of outgoing htlcs per channel HOT 2
- Feature request: Avoid channels below fee HOT 3
- Support Inbound Fees when LND 18 is released. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from regolancer.