it's also safer because readers don't block and writes are serialized and
do block.


2014-05-13 15:32 GMT+02:00 Kristian Amlie <notifications@github.com>:

> In libpromises/lastseen.c:
>
> > @@ -515,7 +515,13 @@ bool ScanLastSeenQuality(LastSeenQualityCallback callback, void *ctx)
> >      }
> >
> >      DeleteDBCursor(cursor);
> > -
> > +    CloseDB(db);
> > +
> > +    if (!OpenDB(&db, dbid_lastseen))
> > +    {
> > +        Log(LOG_LEVEL_ERR, "Unable to re-open lastseen database");
> > +        return false;
> > +    }
>
> Cheaper yes, but not safer. Both choices are equally safe, it's just that
> with 0 (read/write) you get less parallellism. That's why we start out with
> RDONLY for ReadDB. We could probably do something similar for cursors,
> but that work has not been done yet.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/cfengine/core/pull/1698/files#r12582567>
> .
>