Re: [PATCH v2] Use the Xapian::DB_RETRY_LOCK flag when available

Subject: Re: [PATCH v2] Use the Xapian::DB_RETRY_LOCK flag when available

Date: Thu, 05 May 2016 07:33:25 -0300

To: Istvan Marko, Jani Nikula, notmuch@notmuchmail.org

Cc:

From: David Bremner


Istvan Marko <notmuch@kismala.com> writes:

> Regarding tests, I couldn't think of a meaningful test for this. We get
> different behaviors depending on the Xapian version and if we try do
> some kind of a concurrent locking test we'd really be just testing
> Xapian's locking code rather than notmuch.

We would be testing the build/configuration part to make sure we are
enabling the right flags, but more importantly testing the error
handling code, since we have to catch exceptions and pass them back
through the C library interface as error codes. One thing that would
make this easier to test is adding some finer grain errors than
"NOTMUCH_STATUS_XAPIAN_EXCEPTION" for notmuch_database_open_verbose to
return, to distinguish between the case of immediate failure and
timeout.  Although it's not clear to me that Xapian actually provides a
timeout when DB_RETRY_LOCK is used.

Thread: