Kouya Shimura
2010-Dec-14 08:38 UTC
[Xen-devel] [PATCH] tools/hotplug/Linux: forced to release lock if holder process is gone
When a script using locking.sh is stopped by ctrl-C, the lock file remains. We have to wait 100 seconds for releasing the lock at the next time. Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2010-Dec-14 17:16 UTC
Re: [Xen-devel] [PATCH] tools/hotplug/Linux: forced to release lock if holder process is gone
Kouya Shimura writes ("[Xen-devel] [PATCH] tools/hotplug/Linux: forced to release lock if holder process is gone"):> When a script using locking.sh is stopped by ctrl-C, the lock file remains. > We have to wait 100 seconds for releasing the lock at the next time.Thanks, I have applied your patch. This kind of thing is one reason why lockfiles where the lock is regarded as held if the file exists are horrible. It''s a shame that we don''t have any fcntl/flock style locking primitives available in shell. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kouya Shimura
2010-Dec-15 04:26 UTC
Re: [Xen-devel] [PATCH] tools/hotplug/Linux: forced to release lock if holder process is gone
Sorry, the patch was unsafe for mutual exclusion. Please apply this too. Since there is a case that the owner file doesn''t exist yet when an atomic mkdir operation fails. Thanks, Kouya Ian Jackson writes:> Kouya Shimura writes ("[Xen-devel] [PATCH] tools/hotplug/Linux: forced to release lock if holder process is gone"): > > When a script using locking.sh is stopped by ctrl-C, the lock file remains. > > We have to wait 100 seconds for releasing the lock at the next time. > > Thanks, I have applied your patch. > > This kind of thing is one reason why lockfiles where the lock is > regarded as held if the file exists are horrible. It''s a shame that > we don''t have any fcntl/flock style locking primitives available in > shell. > > Ian.Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2010-Dec-15 16:49 UTC
Re: [Xen-devel] [PATCH] tools/hotplug/Linux: forced to release lock if holder process is gone
Kouya Shimura writes ("Re: [Xen-devel] [PATCH] tools/hotplug/Linux: forced to release lock if holder process is gone"):> Sorry, the patch was unsafe for mutual exclusion. Please apply this too. > Since there is a case that the owner file doesn''t exist yet > when an atomic mkdir operation fails.Applied, thanks. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel