user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] search: lookup_mail handles modified DBs
@ 2016-12-22  7:55 Eric Wong
  2016-12-22  7:59 ` Eric Wong
  2016-12-22  8:00 ` [PATCH v2] " Eric Wong
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2016-12-22  7:55 UTC (permalink / raw)
  To: meta

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-22  8:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-22  7:55 [PATCH] search: lookup_mail handles modified DBs Eric Wong
2016-12-22  7:59 ` Eric Wong
2016-12-22  8:00 ` [PATCH v2] " Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).