From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id CAD091FF76 for ; Thu, 22 Dec 2016 07:55:49 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] search: lookup_mail handles modified DBs Date: Thu, 22 Dec 2016 07:55:49 +0000 Message-Id: <20161222075549.12039-1-e@80x24.org> List-Id: We call lookup_mail all over the place, be sure we can handle database modifications in those cases. --- lib/PublicInbox/Search.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 24cb266..82da262 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -295,8 +295,10 @@ sub lookup_message { sub lookup_mail { # no ghosts! my ($self, $mid) = @_; - my $smsg = lookup_message($self, $mid) or return; - PublicInbox::SearchMsg->load_doc($smsg->{doc}); + retry_reopen(sub { + my $smsg = lookup_message($self, $mid) or return; + PublicInbox::SearchMsg->load_doc($smsg->{doc}); + }); } sub find_unique_doc_id { -- EW