]> git.ipfire.org Git - thirdparty/public-inbox.git/commit
imap_searchqp: avoid occasional P::RD hint spew
authorEric Wong <e@80x24.org>
Fri, 14 Feb 2025 09:38:55 +0000 (09:38 +0000)
committerEric Wong <e@80x24.org>
Sat, 15 Feb 2025 07:05:04 +0000 (07:05 +0000)
commita624a643d69beef8ede8075afe6fd1ab874dfe25
tree0ab39569216cc4f598bda54d504e6ff5a399183a
parent2a3c504f6e10c0eb81ff2c4289166396584f9a04
imap_searchqp: avoid occasional P::RD hint spew

It turns out Inline::C::Parser::RecDescent increments $::RD_HINT
when Inline::C rebuilds are necessary, thus causing verbose log
spew on bogus IMAP search queries in our own use of
Parse::RecDescent.  So, local-ize $::RD_HINT as we do with other
$::RD_* vars to avoid Inline::C influencing our IMAP query
parsing.

Triggering the increment of $::RD_HINT via
Inline::C::Parser::RecDescent may be achieved by forcing an
Inline::C rebuild, such as clearing the contents of
~/.cache/public-inbox/inline-c/* or
$ENV{PERL_INLINE_DIRECTORY}/* (but leaving one of those
top-level directories to trigger Inline::C rebuilds.  This bug
mainly manifested in t/imap_searchqp.t under the `make
check-run' test target which reuses existing processes to speed
up tests, though it could manifest in real-world -imapd (and
-netd) usage if the process spawning the daemon built Inline::C
code.
lib/PublicInbox/IMAPsearchqp.pm
t/imap_searchqp.t