]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei: diagnostics for /Document \d+ not found/ errors
authorEric Wong <e@80x24.org>
Sat, 14 Aug 2021 00:29:42 +0000 (00:29 +0000)
committerEric Wong <e@80x24.org>
Sat, 14 Aug 2021 05:57:46 +0000 (05:57 +0000)
This may help diagnose "Exception: Document \d+ not found"
errors I'm seeing from "lei up" with HTTPS endpoints.

lib/PublicInbox/IPC.pm
lib/PublicInbox/LeiSearch.pm

index 497a6035aa747704f189f2c740d91cd26174c5fa..d909dc1c66357eaa46116e6111ea83cbcb329e0a 100644 (file)
@@ -236,7 +236,7 @@ sub recv_and_run {
        undef $buf;
        my $sub = shift @$args;
        eval { $self->$sub(@$args) };
-       warn "$$ wq_worker: $@" if $@;
+       warn "$$ $0 wq_worker: $@" if $@;
        delete @$self{0..($nfd-1)};
        $n;
 }
index 79b2fd7d165e2c3e46fefce98a73d29e48e33e2c..f9e5c8e9846ca4ab7c9626f31d77b9fd97dda176 100644 (file)
@@ -55,13 +55,16 @@ sub _xsmsg_vmd { # retry_reopen
        $kw{flagged} = 1 if delete($smsg->{lei_q_tt_flagged});
        my @num = $self->over->blob_exists($smsg->{blob});
        for my $num (@num) { # there should only be one...
-               $doc = $xdb->get_document(num2docid($self, $num));
-               $x = xap_terms('K', $doc);
-               %kw = (%kw, %$x);
-               if ($want_label) { # JSON/JMAP only
-                       $x = xap_terms('L', $doc);
-                       %L = (%L, %$x);
-               }
+               eval {
+                       $doc = $xdb->get_document(num2docid($self, $num));
+                       $x = xap_terms('K', $doc);
+                       %kw = (%kw, %$x);
+                       if ($want_label) { # JSON/JMAP only
+                               $x = xap_terms('L', $doc);
+                               %L = (%L, %$x);
+                       }
+               };
+               warn "$$ $0 #$num (nshard=$self->{nshard}) $smsg->{blob}: $@";
        }
        $smsg->{kw} = [ sort keys %kw ] if scalar(keys(%kw));
        $smsg->{L} = [ sort keys %L ] if scalar(keys(%L));