From: Eric Wong <e@80x24.org>
To: "Thomas Weißschuh" <thomas@t-8ch.de>
Cc: meta@public-inbox.org
Subject: Re: lei-q-remote-import failures [was: [PATCH] t/index-git-times: support non-master default branch]
Date: Wed, 27 Oct 2021 23:48:56 +0000 [thread overview]
Message-ID: <20211027234856.M792093@dcvr> (raw)
In-Reply-To: <52653367-9aac-45a7-9d3d-56dacfe36905@t-8ch.de>
Thomas Weißschuh <thomas@t-8ch.de> 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 <qp@example.com>' + '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);
next prev parent reply other threads:[~2021-10-27 23:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-25 22:24 [PATCH] t/index-git-times: support non-master default branch Thomas Weißschuh
2021-10-25 22:58 ` Eric Wong
2021-10-26 5:05 ` Thomas Weißschuh
2021-10-26 5:28 ` Eric Wong
2021-10-26 18:43 ` Thomas Weißschuh
2021-10-27 21:15 ` lei-q-remote-import failures [was: [PATCH] t/index-git-times: support non-master default branch] Eric Wong
2021-10-27 21:24 ` Thomas Weißschuh
2021-10-27 23:48 ` Eric Wong [this message]
2021-10-28 14:03 ` Thomas Weißschuh
2021-10-28 19:16 ` [PATCH] test_common: clear XDG_CACHE_HOME before lei tests Eric Wong
2021-10-28 19:22 ` Thomas Weißschuh
2021-10-26 21:24 ` [PATCH] t/index-git-times: support non-master default branch Thomas Weißschuh
2021-10-27 4:07 ` [PATCH] test_common: key test inboxes to init.defaultBranch Eric Wong
2021-10-27 5:04 ` Thomas Weißschuh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211027234856.M792093@dcvr \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
--cc=thomas@t-8ch.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).