Comments (6)
I tried individually each path from https://github.com/trbs/pid/blob/master/pid/utils.py#L26-L29, everything is working fine and I can not reproduce the issue I had, even whiteout specifying piddir
it works.
I'll leave a comment if the issue re-appear.
from pid.
from pid.
The method deploy() takes quite a lot of time to be executed. It actually use subprocess.Popen and spawn an ansible command that execute a playbook. I have seen some issue at this stage with the lock. But this is not always happening and sometime it works and some time the script does not care about the lock.
Here is the complete script : https://gitlab.com/bibliosansfrontieres/tm/factory_manager/blob/master/scripts/kea/deploy.py#L248-253
I'm probably missing something...
from pid.
It seems like it "should-just-work(tm)"...
Can't quickly see why this would fail in your script...
Some things to try from the top of my head:
- Try using
PidFile(register_atexit=False)
just in case... (although since your using stock Python mostly I don't see why this would matter) - Try setting the debug log level (for PidFile Logger) and watch for the 'create pidfile' and 'closing pidfile' lines.
- Is anything else maybe cleaning up the file ? (some
tmpreaper
type process on the machine ?) (in this case Barend's suggestion for little test script with time.sleep(...) should show the same behavior...) - If you suspect (or want to rule out) something else in the system you could try using
Pidfile(piddir="/some/test/directory")
from pid.
thanks @trbs for your help ! I managed to have my script behave as expected. I used piddir="/some/test/directory"
to specify the directory. I guess the regular /run/user/%s/
did not work so well with my system (Ubuntu 16.04.7 LTS)
from pid.
Good to hear that you got it to work :-)
I am still very curious was the root cause of this issue is.
This might be a caveat to warn other people about... or maybe even change the default piddir
if need be...
@fheslouin if you might have some time could you make a simple test case that (as reliable as possible) triggers this ?
from pid.
Related Issues (20)
- Incorrect PID tracking when used in conjunction with python-daemon. HOT 15
- it doesnot support multithread # it does. my fault.
- Same pid support HOT 1
- PID file is not getting created HOT 7
- Update pip pls HOT 1
- Muliplatform locking
- samepid feature doesn't work as expected HOT 2
- Test test_pid_check_samepid_two_processes fails on FreeBSD HOT 6
- Double close HOT 3
- atexit registration is never done HOT 3
- 2.2.4 deletes pid file while script is still running HOT 5
- Better API support for querying HOT 2
- Support contextlib.ContextDecorator? HOT 3
- PID conflict with logging module HOT 8
- Pidfile location on Windows HOT 3
- Document PidFileBase constructor arguments HOT 1
- pid file in virtual environments (feature discussion) HOT 1
- docker usage left pid file alive in case of crash HOT 1
- Check if PidFile is locked without actually locking it
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 pid.