In id:1487583702.5ghl7kdkaw.astroid@strange.none Gaute provided a test case that demonstrated an uncaught Xapian::DatabaseModifiedError in _notmuch_message_ensure_metadata. Starting with id:20170218144551.22925-2-david@tethera.net, I provided one approach to dealing with this via error propagation. I believe the current series is a better approach because it actually fixes the problem (i.e. re-opens the database), and because it takes less code. There are probably plenty of other places where the new notmuch_database_open needs to be called.