c-pac > Problems with portalocker.py
Showing 1-1 of 1 posts
Feb 19, 2016 07:02 PM | Christina Fales - Feinstein Inst Div of Psychiatry Research-Zucker Hillside Hospital
Problems with portalocker.py
Hi CPAC guys/gals:
A couple of months ago I asked about problems getting file locks when CPAC calls portalocker.py. You directed me to the Nipype folks who wrote the routine. I didn't get very far with them (and also have had to focus on other tasks for a while) so I am just now turning back to you. The problem is that portalocker.py uses the flock method when calling for locks, and flock apparently doesn't work with NFS. So I attempted to modify portalocker.py on our system so that it uses fcntl.lockf() instead. No luck. Still getting an Exception #37 ("No locks available"). (I've attached the modified version of portalocker.py... my changes are indicated with a "CF" comment.)
We also tried giving the various NFS servers the "nolock" attribute, which I gather should allow simultaneous locking of the log file, as along as the different users are on separate machines. (I'm not sure if this helps exactly, as the two accesses could very likely originate on the same machine.)
Could you offer any suggestions?
Thanks very much,
Christina Fales
Div. of Psychiatry Research
Feinstein Inst for Med Rsch
Zucker Hillside Hospital
265-31 76th Avenue
Glen Oaks, NY 11004
A couple of months ago I asked about problems getting file locks when CPAC calls portalocker.py. You directed me to the Nipype folks who wrote the routine. I didn't get very far with them (and also have had to focus on other tasks for a while) so I am just now turning back to you. The problem is that portalocker.py uses the flock method when calling for locks, and flock apparently doesn't work with NFS. So I attempted to modify portalocker.py on our system so that it uses fcntl.lockf() instead. No luck. Still getting an Exception #37 ("No locks available"). (I've attached the modified version of portalocker.py... my changes are indicated with a "CF" comment.)
We also tried giving the various NFS servers the "nolock" attribute, which I gather should allow simultaneous locking of the log file, as along as the different users are on separate machines. (I'm not sure if this helps exactly, as the two accesses could very likely originate on the same machine.)
Could you offer any suggestions?
Thanks very much,
Christina Fales
Div. of Psychiatry Research
Feinstein Inst for Med Rsch
Zucker Hillside Hospital
265-31 76th Avenue
Glen Oaks, NY 11004