You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by "bigio (via GitHub)" <gi...@apache.org> on 2026/07/21 21:50:34 UTC

[PR] Cache eval-plugin glue methods for the process lifetime, not per message [spamassassin]

bigio opened a new pull request, #34:
URL: https://github.com/apache/spamassassin/pull/34

   PerMsgStatus::finish() undefined every register_plugin_eval_glue() generated wrapper sub (and any register_generated_rule_method() plugin subs) and cleared their tracking hash after every single message, even though this glue is 100% static per-config -- forcing a fresh eval() compile of every distinct eval-plugin function on every message instead of once per process, the same "compile once, reuse" pattern Check.pm already uses for its rule subs.
   It also contradicted register_generated_rule_method()'s documented contract, which says these methods are destroyed at Mail::SpamAssassin::finish() (session end), not per-message.
   
   Move the cleanup to Mail::SpamAssassin::finish(), alongside the existing finish_tests plugin-hook cleanup. Since that code runs outside the PerMsgStatus package, bare (non-fully-qualified) method names now need explicit qualification to avoid undefining the wrong symbol.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@spamassassin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Cache eval-plugin glue methods for the process lifetime, not per message [spamassassin]

Posted by "asf-gitbox-commits (via GitHub)" <gi...@apache.org>.
asf-gitbox-commits closed pull request #34: Cache eval-plugin glue methods for the process lifetime, not per message
URL: https://github.com/apache/spamassassin/pull/34


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@spamassassin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Cache eval-plugin glue methods for the process lifetime, not per message [spamassassin]

Posted by "fkoyer (via GitHub)" <gi...@apache.org>.
fkoyer commented on PR #34:
URL: https://github.com/apache/spamassassin/pull/34#issuecomment-5042893265

   Good catch. +1
   
   I think we could refactor the code so the glue functions aren't necessary at all. But that would be a separate PR. This PR is still needed to cleanup @TEMPORARY_METHODS that are registered by register_generated_rule_method. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@spamassassin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org