about summary refs log tree commit homepage
path: root/lib/PublicInbox/Inbox.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-08-20 20:24:43 +0000
committerEric Wong <e@yhbt.net>2020-08-20 21:11:13 +0000
commit4d8a07616ebe29771c9775173e9d01a91ec677ae (patch)
treebdcb09572eda8eaf16c7d5f537798b5e7112ea75 /lib/PublicInbox/Inbox.pm
parent11f44fc4381899f703f0bac15a8c40dfd652873c (diff)
downloadpublic-inbox-4d8a07616ebe29771c9775173e9d01a91ec677ae.tar.gz
While this is unlikely to be a problem in current practice,
keeping Xapian DBs open for long responses can interfere with
free space recovery after -compact.

In the future, it will interfere with inbox search grouping
and lead to unexpected results.
Diffstat (limited to 'lib/PublicInbox/Inbox.pm')
-rw-r--r--lib/PublicInbox/Inbox.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index 267be4e3..55e546e1 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -191,14 +191,19 @@ sub mm {
         };
 }
 
-sub search ($;$) {
-        my ($self, $over_only) = @_;
+sub search ($;$$) {
+        my ($self, $over_only, $ctx) = @_;
         my $srch = $self->{search} ||= eval {
                 _cleanup_later($self);
                 require PublicInbox::Search;
                 PublicInbox::Search->new($self);
         };
-        ($over_only || eval { $srch->xdb }) ? $srch : undef;
+        ($over_only || eval { $srch->xdb }) ? $srch : do {
+                $ctx and $ctx->{env}->{'psgi.errors'}->print(<<EOF);
+`$self->{name}' search went away unexpectedly
+EOF
+                undef;
+        };
 }
 
 sub over ($) {