On Thu, Apr 25, 2013 at 04:06:35PM -0700, Gurucharan Shetty wrote:
> On Thu, Apr 25, 2013 at 2:37 PM, Justin Pettit <jpet...@nicira.com> wrote:
> 
> >
> > On Apr 25, 2013, at 10:33 AM, Ben Pfaff <b...@nicira.com> wrote:
> >
> > > On Mon, Apr 08, 2013 at 10:51:44AM -0700, Justin Pettit wrote:
> > >> @@ -2274,7 +2274,8 @@ bridge_run(void)
> > >>             struct bridge *br, *next_br;
> > >>
> > >>             VLOG_ERR_RL(&rl, "another ovs-vswitchd process is running, "
> > >> -                        "disabling this process until it goes away");
> > >> +                        "disabling this process (%d) until it goes
> > away",
> > >> +                        getpid());
> > >
> > > pid_t isn't necessarily compatible with int.  It might be any integer
> > > type.  The cautious thing to do is to cast it to some specific integer
> > > type to use it with a format string.  I usually cast to "long int" and
> > > use %ld.
> > >
> > > I might say (pid %ld) instead of just (%d) to make it really clear
> > > what the number is.
> >
> > Good points.  I updated the commit with those changes and pushed it.
> >
> 
> Is there any reason we don't exit when we know that another vswitchd
> process is running?
> We do that when we know that another process owns the pidfile lock.

At the time we introduced this code, I was getting a lot of pressure
from our manager at the time (Sanjay) to implement "hitless upgrade"
in which one could do an upgrade of Open vSwitch without dropping any
packets.  This was going to be part of the strategy, the idea being that
you start up the new version of ovs-vswitchd before you kill the old
one, to let it figure out the configuration and prepare to take over,
and when it's done with that kill the old one and let the new one obtain
the lock and seamlessly take over.

The pressure for hitless upgrade went away when Sanjay did, so there
might not be a reason anymore.

I'm not sure whether it's a good idea to let anyone who has access to
OVSDB kill ovs-vswitchd by stealing the lock.  We do put a lot of trust
in OVSDB clients already.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to