[lxc-devel] [PATCH 1/2] Support starting containers concurrently

S.Çağlar Onur caglar at 10ur.org
Wed Apr 17 22:24:48 UTC 2013


Hi Serge,


On Wed, Apr 17, 2013 at 6:02 PM, Serge Hallyn <serge.hallyn at ubuntu.com>wrote:

> Quoting S.Çağlar Onur (caglar at 10ur.org):
> > From: "S.Çağlar Onur" <caglar at 10ur.org>
> >
> > Trying to start multiple containers concurrently may cause
> lxc_monitor_read_timeout to fail as select call could be interrupted by a
> signal, handle it.
> >
> > Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>
> > ---
> >  src/lxc/state.c |    9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/lxc/state.c b/src/lxc/state.c
> > index 437f11a..0bb307d 100644
> > --- a/src/lxc/state.c
> > +++ b/src/lxc/state.c
> > @@ -231,8 +231,13 @@ extern int lxc_wait(const char *lxcname, const char
> *states, int timeout, const
> >                               goto out_close;
> >                       curtime = tv.tv_sec;
> >               }
> > -             if (lxc_monitor_read_timeout(fd, &msg, timeout) < 0)
> > -                     goto out_close;
> > +             if (lxc_monitor_read_timeout(fd, &msg, timeout) < 0) {
> > +                     /* continue if select interrupted by signal */
> > +                     if (errno == EINTR)
> > +                             continue;
>
> Hm, wait, sorry - you need to recalculate the timeout here (if not -1)?
>

Ah, good catch, I'll wait Stéphane's response to other patch and submit
them together.


> > +                     else
> > +                             goto out_close;
> > +             }
> >
> >               if (timeout != -1) {
> >                       retval = gettimeofday(&tv, NULL);
> > --
> > 1.7.10.4
> >
> >
> >
> ------------------------------------------------------------------------------
> > Precog is a next-generation analytics platform capable of advanced
> > analytics on semi-structured data. The platform includes APIs for
> building
> > apps and a phenomenal toolset for data science. Developers can use
> > our toolset for easy data analysis & visualization. Get a free account!
> > http://www2.precog.com/precogplatform/slashdotnewsletter
> > _______________________________________________
> > Lxc-devel mailing list
> > Lxc-devel at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/lxc-devel
>



-- 
S.Çağlar Onur <caglar at 10ur.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20130417/7e4d050a/attachment.html>


More information about the lxc-devel mailing list