I had some issues with puppet provisioning where two python executables were exiting with 1 instead of 0 (in unix means something went terribly wrong :D) and no logs were recorded eventhough I’ve written bunch of logging lines (that’s very unfortunate). It was later discovered that there were race conditions were these two python executables should not run concurrently. A solution to this was using file locking. As I only need one of them to be executed, possible way out is to stop execution if a lock is detected.
So I experiment with some simple codes like below:
Read the rest of this entry »