From 322a79a6421b5993775f63ea25294a97c5203ac0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 14 Jul 2020 02:14:31 +0000 Subject: nntpd+imapd: detect unlinked msgmap While it's even less common to experience a replaced msgmap.sqlite3 file, BOFHs may do the darndest things. This is another step towards reducing the number of needless wakeups we need to do in long-lived read-only daemons. --- lib/PublicInbox/Inbox.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/Inbox.pm') diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 02186dac..3d9754dc 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -31,7 +31,7 @@ sub cleanup_task () { for my $ibx (values %$CLEANUP) { my $again; if ($have_devel_peek) { - foreach my $f (qw(mm search)) { + foreach my $f (qw(search)) { # we bump refcnt by assigning tmp, here: my $tmp = $ibx->{$f} or next; next if Devel::Peek::SvREFCNT($tmp) > 2; @@ -47,7 +47,7 @@ sub cleanup_task () { } check_inodes($ibx); if ($have_devel_peek) { - $again ||= !!($ibx->{mm} || $ibx->{search}); + $again ||= !!$ibx->{search}; } $next->{"$ibx"} = $ibx if $again; } @@ -182,7 +182,6 @@ sub mm { my ($self) = @_; $self->{mm} ||= eval { require PublicInbox::Msgmap; - _cleanup_later($self); my $dir = $self->{inboxdir}; if ($self->version >= 2) { PublicInbox::Msgmap->new_file("$dir/msgmap.sqlite3"); @@ -409,7 +408,7 @@ sub unsubscribe_unlock { sub check_inodes ($) { my ($self) = @_; - for (qw(over)) { # TODO: search, mm + for (qw(over mm)) { # TODO: search $self->{$_}->check_inodes if $self->{$_}; } } -- cgit v1.2.3-24-ge0c7