[ovs-dev] [PATCH] ovsdb-tool: Don't wait for lockfiles on "compact" or "convert".
Ben Pfaff
blp at nicira.com
Mon Jun 14 23:13:38 UTC 2010
On Mon, Jun 14, 2010 at 03:18:47PM -0700, Jesse Gross wrote:
> On Wed, Jun 9, 2010 at 11:24 AM, Ben Pfaff <blp at nicira.com> wrote:
>
> > Until now, "ovsdb-tool convert" and "ovsdb-tool compact" were willing to
> > wait an arbitrarily long time to get a lock on the database or on a
> > temporary file. In practice, though, the program most likely to have the
> > lock is ovsdb-server, which is not a transient process, and thus
> > ovsdb-tool will likely wait indefinitely if it waits at all.
> >
> > This commit changes these ovsdb-tool commands so that they won't wait at
> > all if some other program has the lock. (The other commands already had
> > this behavior.)
>
> I wonder if it might be better to have a short period to wait rather than
> none at all. That would still avoid a deadlock when ovsdb-server is running
> while avoiding errors that might seem somewhat random if there is another
> transient process.
Hmm, I'm unsure. With or without waiting for a short period, there
would be a race condition. Waiting for a short period might paper over
that race condition most of the time in practice, but then you'd get
some corner case where, say, "ovsdb-tool compact" runs on a larger
database than usual and thus takes longer than usual, and then somebody
loses the race.
Off-hand, I'd rather be *more* likely to lose the race, because then
we'll be able to find and fix the problem more quickly.
Any further thoughts?
More information about the dev
mailing list