From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id DBC901F953; Wed, 27 Oct 2021 23:48:56 +0000 (UTC) Date: Wed, 27 Oct 2021 23:48:56 +0000 From: Eric Wong To: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= Cc: meta@public-inbox.org Subject: Re: lei-q-remote-import failures [was: [PATCH] t/index-git-times: support non-master default branch] Message-ID: <20211027234856.M792093@dcvr> References: <20211025222453.252181-1-thomas@t-8ch.de> <20211025225822.GA28875@dcvr> <20211026052815.GA13265@dcvr> <20211027211515.M84746@dcvr> <52653367-9aac-45a7-9d3d-56dacfe36905@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <52653367-9aac-45a7-9d3d-56dacfe36905@t-8ch.de> List-Id: Thomas Weißschuh wrote: > It didn't help, neither did larger sleeps. Thanks for testing. > I'll see if I can debug it in the coming days. OK, maybe the patch below can get you started... I've also been wondering if something like GIT_TRACE is necessary, but it's also more work to support + document. And Perl code is easily modified compared to AOT languages. diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 2a037f2bd79b..a0982138966e 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -281,13 +281,19 @@ sub each_remote_eml { # callback for MboxReader->mboxrd my ($eml, $self, $lei, $each_smsg) = @_; my $xoids = $lei->{ale}->xoids_for($eml, 1); my $smsg = bless {}, 'PublicInbox::Smsg'; + use Data::Dumper; if ($self->{import_sto} && !$xoids) { my ($res, $kw) = $self->{import_sto}->wq_do('add_eml', $eml); if (ref($res) eq ref($smsg)) { # totally new message $smsg = $res; + $lei->qerr("# imported <$smsg->{mid}>") if $ENV{DBG}; $self->{-imported} = 1; + } elsif ($ENV{DBG}) { + $lei->qerr("# res, kw = ".Dumper([$res, $kw])); } $smsg->{kw} = $kw; # short-circuit xsmsg_vmd + } elsif ($ENV{DBG}) { + $lei->qerr("# no import $self->{import_sto}".Dumper($xoids)); } $smsg->{blob} //= $xoids ? (keys(%$xoids))[0] : $lei->git_oid($eml)->hexdigest; @@ -378,6 +384,9 @@ sub query_remote_mboxrd { $lei, $each_smsg); if ($self->{import_sto} && delete($self->{-imported})) { my $wait = $self->{import_sto}->wq_do('done'); + $lei->qerr("# flushed imported messages") if $ENV{DBG}; + } elsif ($ENV{DBG}) { + $lei->qerr("# nothing flushed $self->{import_sto}"); } $reap_curl->join; if ($? == 0) { diff --git a/t/lei-q-remote-import.t b/t/lei-q-remote-import.t index 92d8c9b6058c..e10af2eb7849 100644 --- a/t/lei-q-remote-import.t +++ b/t/lei-q-remote-import.t @@ -32,7 +32,11 @@ test_lei({ tmpdir => $tmpdir }, sub { lei_ok(@cmd); ok(-f $o && !-s _, 'output exists but is empty'); unlink $o or BAIL_OUT $!; - lei_ok(@cmd, '-I', $url); + lei_ok([@cmd, '-I', $url], { DBG => 1 }); + +# should say 'imported ' + 'flushed imported messages' + diag $lei_err; +return; # drop this if the above diag looks right is_deeply($slurp_emls->($o), $exp1, 'got results after remote search'); unlink $o or BAIL_OUT $!; lei_ok(@cmd);