From 36c0c299ee9a8bb9cd6a64c516e395e6f2ebe478 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 31 Aug 2023 08:38:57 +0000 Subject: xap_helper: deal with Xapian::DocNotFoundError It's possible for a long mset streaming operation to hit missing documents after a database reopen if deletes hit the DB. --- lib/PublicInbox/XapHelper.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/XapHelper.pm') diff --git a/lib/PublicInbox/XapHelper.pm b/lib/PublicInbox/XapHelper.pm index ef6a47a3..36266e65 100644 --- a/lib/PublicInbox/XapHelper.pm +++ b/lib/PublicInbox/XapHelper.pm @@ -37,9 +37,15 @@ sub cmd_test_inspect { } sub iter_retry_check ($) { - die unless ref($@) =~ /\bDatabaseModifiedError\b/; - $_[0]->{srch}->reopen; - undef; # retries + if (ref($@) =~ /\bDatabaseModifiedError\b/) { + $_[0]->{srch}->reopen; + undef; # retries + } elsif (ref($@) =~ /\bDocNotFoundError\b/) { + warn "doc not found: $@"; + 0; # continue to next doc + } else { + die; + } } sub dump_ibx_iter ($$$) { -- cgit v1.2.3-24-ge0c7