about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-05-28 00:07:54 +0000
committerEric Wong <e@80x24.org>2021-05-28 03:49:27 +0000
commit578520277aaf723b174a2567aff90c10e29abbcb (patch)
tree7675f1b861ddd827daec2e66b02c866bac903809
parent552e04a17e083c62d73879da6349bc2465a0ecbd (diff)
downloadpublic-inbox-578520277aaf723b174a2567aff90c10e29abbcb.tar.gz
I'm not 100% sure why, but "lei up" seems to cause uncommitted
transaction errors.  LeiToMail calls sto->set_sync_info, but
LeiXSearch should call sto->done and lms_commit, so I'm not
sure where the uncommited transaction is coming from...
-rw-r--r--lib/PublicInbox/LeiMailSync.pm10
-rw-r--r--lib/PublicInbox/LeiXSearch.pm3
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/PublicInbox/LeiMailSync.pm b/lib/PublicInbox/LeiMailSync.pm
index d9c30580..6120d59f 100644
--- a/lib/PublicInbox/LeiMailSync.pm
+++ b/lib/PublicInbox/LeiMailSync.pm
@@ -356,4 +356,14 @@ sub forget_folder {
         $dbh->do('DELETE FROM folders WHERE fid = ?', undef, $fid);
 }
 
+# FIXME: something with "lei <up|q>" is causing uncommitted transaction
+# warnings, not sure what...
+sub DESTROY {
+        my ($self) = @_;
+        my $dbh = $self->{dbh} or return;
+        return if $dbh->{ReadOnly};
+        use Carp;
+        warn "BUG $$ $0 $self {dbh} UNCOMMITTED ", Carp::longmess();
+}
+
 1;
diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm
index 3482082d..e2a8e8e3 100644
--- a/lib/PublicInbox/LeiXSearch.pm
+++ b/lib/PublicInbox/LeiXSearch.pm
@@ -357,6 +357,9 @@ sub query_done { # EOF callback for main daemon
         if (my $lxs = delete $lei->{lxs}) {
                 $lxs->wq_wait_old(\&xsearch_done_wait, $lei);
         }
+        if ($lei->{opt}->{'mail-sync'} && !$lei->{sto}) {
+                warn "BUG: {sto} missing with --mail-sync";
+        }
         my $wait = $lei->{sto} ? $lei->{sto}->ipc_do('done') : undef;
         $lei->{ovv}->ovv_end($lei);
         my $start_mua;