openstack team mailing list archive
-
openstack team
-
Mailing list archive
-
Message #14642
Re: File injection support
On Friday, July 13, 2012 at 20:35 PM, Pádraig Brady wrote:
> >
> > More interesting though, and what might be of use to other people, the
> > "kpartx -a" calls get run and then the code in nova/virt/disk/mount.py
> > immediately checks for whether or not the newly created
> > /dev/mapper/nbdXXpX partitions exist. They'd actually get created but
> > the os.exists call would fail. Apparently the os.exists call was
> > getting run too soon. I added a time.sleep() after both the 'kpartx
> > -a' and 'kpartx -d' calls, to give things time to catch up before the
> > os.exists calls and things worked much better.
>
> Sigh.
>
> The amount of synchronization bugs I've noticed in lower
> Linux layers lately is worrying.
>
The kernel tools can certainly be asynchronous at times.
Perhaps try to see if using inotify would solve this. It is platform-dependent, but it is the best way to solve these problems without race conditions. If we're calling kpartx, platform independence is unlikely to be an issue anyway.
However, if compatibility is desired, BSD/MacOS provide similar functionality via kqueue, and Windows FindFirstChangeNotification.
Regards,
Eric Windisch
References
-
File injection support
From: Nicolae Paladi, 2012-05-29
-
Re: File injection support
From: Pádraig Brady, 2012-05-29
-
Re: File injection support
From: Fredric Morenius, 2012-05-30
-
Re: File injection support
From: Pádraig Brady, 2012-05-30
-
Re: File injection support
From: Fredric Morenius, 2012-06-08
-
Re: File injection support
From: Pádraig Brady, 2012-06-08
-
Re: File injection support
From: Scott Moser, 2012-06-08
-
Re: File injection support
From: Pádraig Brady, 2012-06-08
-
Re: File injection support
From: Vishvananda Ishaya, 2012-06-10
-
Re: File injection support
From: Fredric Morenius, 2012-06-11
-
Re: File injection support
From: Scott Moser, 2012-06-11
-
Re: File injection support
From: Fredric Morenius, 2012-06-12
-
Re: File injection support
From: Pádraig Brady, 2012-06-12
-
Re: File injection support
From: Mark Moseley, 2012-07-13
-
Re: File injection support
From: Pádraig Brady, 2012-07-14