]> Sergey Matveev's repositories - public-inbox.git/commitdiff
daemon: warn on missing blobs
authorEric Wong <e@yhbt.net>
Sun, 5 Jul 2020 23:27:58 +0000 (23:27 +0000)
committerEric Wong <e@yhbt.net>
Mon, 6 Jul 2020 20:01:15 +0000 (20:01 +0000)
Since -edit and -purge should be rare and TOCTOU around them
rarer still; missing {blobs} could be indicative of a real bug
elsewhere.  Warn on them.

And I somehow ended up with 3 different field names for Inbox
objects.  Perhaps they'll be made consistent in the future.

lib/PublicInbox/GzipFilter.pm
lib/PublicInbox/IMAP.pm
lib/PublicInbox/NNTP.pm

index 57344604b30f7e07d1434a601296eab81eaeb625..b5ad9eb884cd7a57989b1ec1e9102f35d00bb826 100644 (file)
@@ -170,6 +170,7 @@ sub async_blob_cb { # git->cat_async callback
        if (!defined($oid)) {
                # it's possible to have TOCTOU if an admin runs
                # public-inbox-(edit|purge), just move onto the next message
+               warn "E: $smsg->{blob} missing in $self->{-inbox}->{inboxdir}\n";
                return $http->next_step($self->{async_next});
        }
        $smsg->{blob} eq $oid or bail($self, "BUG: $smsg->{blob} != $oid");
index e0602143835baed35dcc164b63da0d514acb3f55..d8c898f4b511e1f93bfdcfeac59cc5c7e87a99f0 100644 (file)
@@ -620,6 +620,7 @@ sub fetch_blob_cb { # called by git->cat_async via git_async_cat
        if (!defined($oid)) {
                # it's possible to have TOCTOU if an admin runs
                # public-inbox-(edit|purge), just move onto the next message
+               warn "E: $smsg->{blob} missing in $self->{ibx}->{inboxdir}\n";
                return requeue_once($self);
        } else {
                $smsg->{blob} eq $oid or die "BUG: $smsg->{blob} != $oid";
index 9d91544abd309d7186ceae91e338129a42f1e361..87ddf7a4af83312e41edc775e0794066d73e6ce3 100644 (file)
@@ -523,6 +523,7 @@ sub blob_cb { # called by git->cat_async via git_async_cat
        if (!defined($oid)) {
                # it's possible to have TOCTOU if an admin runs
                # public-inbox-(edit|purge), just move onto the next message
+               warn "E: $smsg->{blob} missing in $self->{ng}->{inboxdir}\n";
                return $self->requeue;
        } elsif ($smsg->{blob} ne $oid) {
                $self->close;