[PATCH] lib: Simplify close and codify aborting atomic section
W. Trevor King
wking at tremily.us
Wed Sep 24 11:18:44 PDT 2014
On Wed, Sep 24, 2014 at 08:09:27PM +0200, David Bremner wrote:
> W. Trevor King writes:
> > Ah, I thought the implicit flush/commit was just in our code.
> > Since it's also in the underlying Xapian close, then this patch
> > looks pretty good to me. I'd mention Xapian's explicit close in
> > the notmuch.h message. Xapain's docs say [1]:
> >
> > For a WritableDatabase, if a transaction is active it will be
> > aborted, while if no transaction is active commit() will be
> > implicitly called.
>
> I'm not sure what you're asking for here by "explicit close". Isn't
> what you quote a restatement of
>
> + * If the caller is currently in an atomic section (there was a
> + * notmuch_database_begin_atomic without a matching
> + * notmuch_database_end_atomic), this will abort the atomic section,
> + * discarding any modifications made in the atomic section.
>
> in terms of underyling Xapian mechanics?
Sorry, I didn't phrase that very well. The notmuch docs (as of this
patch) explain that we don't commit if we're in an atomic block. The
Xapian docs also say that, *and* they say that if we're not in atomic
block the close *does* try to commit. I think that's worth mentioning
in our close docs.
Cheers,
Trevor
--
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20140924/90c2af76/attachment.pgp>
More information about the notmuch
mailing list