[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [xen-unstable test] 13461: regressions - FAIL



On Thu, Jul 05, 2012 at 11:54:14AM +0100, Ian Jackson wrote:
> Daniel P. Berrange writes ("Re: [Xen-devel] [xen-unstable test] 13461: 
> regressions - FAIL"):
> > On Thu, Jul 05, 2012 at 11:40:04AM +0100, Ian Jackson wrote:
> > >  release_lock()
> > >  {
> > >      _setlockfd $1
> > > -    flock -u $_lockfd
> > > +    rm "$_lockfile"
> > 
> > I think you still want the 'flock' line here, but have it after the
> > 'rm' line. Otherwise you leave the $_lockfd filehandle open. Yes,
> > I know the calling script will probably just exit, but it doesn't
> > hurt to be careful here.
> 
> flock -u won't close the fd.  If that's what you want then we would
> have to do so explicitly.
> 
> But, in the meantime the old lockfile exists and is pointlessly
> flocked but is unlinked, which is harmless apart from being a slight
> resource leak.
> 
> Note that anyone who inherits a the fd from the hotplug script will
> end up keeping the file in existence, so closing it here (with or
> without unlocking it) may not do any good.  And if there are no such
> children with a copy of the fd then when the hotplug script dies or
> exits the stale lockfile will be reaped by the kernel.
> 
> So I think it's fine as it is.

Ok, agreed.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.