Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #88392

Re: Lockfile hanling

Date 2015-03-31 17:56 +0200
From Ervin Hegedüs <airween@gmail.com>
Subject Re: Lockfile hanling
References <20150331145012.GA4460@arxnet.hu> <CANc-5Uxa9BZhx2uNMr=ERs7TALCsnKH58YSPW0fVMws9WHJ_+w@mail.gmail.com> <20150331150656.GA4740@arxnet.hu> <CANc-5Uw3A+1csn-w7B=ZP7UCTO9vpjCvKgH8-q23FT3OytvfBA@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.379.1427817358.10327.python-list@python.org> (permalink)

Show all headers | View raw


Hi Skip,

On Tue, Mar 31, 2015 at 10:19:27AM -0500, Skip Montanaro wrote:
> > sorry - at the end of the function there is a close() method to a
> > file, after the thread passes the modifications:
> >
> >     try:
> >         os.remove(self.lockfile)
> >     except:
> >         syslog.syslog(syslog.LOG_DEBUG, "Sync error: " + str(sys.exc_info()[1]))
> 
> Hmmm... Still not seeing os.close(fl)...
> 
> > And I think, the "(deleted)" info near the filename in proc/PID/fd
> > means the lockfile had been deleted.
> 
> os.remove() will remove the lockfile name from the directory. It
> doesn't automatically close the file.

ah, well, many-many-many thanks - that was what I misses...

> >> You might consider the pylockfile module...
> 
> > sounds good, thanks - what's the minimal version of Python? I've
> > only 2.5 on that server...
> 
> When I was still maintaining it, it worked with 2.5, and I distributed
> a patch you could apply to get it to work with 2.4. I'm not sure if
> the current maintainers have changed that. You'd have to look. If
> worse comes to worst, I believe 0.9.1 (the last version I released)
> should still work with 2.5.

thanks for the info - now it works as very well.


a.
 

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Lockfile hanling Ervin Hegedüs <airween@gmail.com> - 2015-03-31 17:56 +0200

csiph-web