[Bug 7735] Meta rules need to handle missing/unrun dependencies

2021-05-15 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7735

Henrik Krohns  changed:

   What|Removed |Added

   Attachment #5743|0   |1
is obsolete||

--- Comment #16 from Henrik Krohns  ---
Created attachment 5744
  --> https://bz.apache.org/SpamAssassin/attachment.cgi?id=5744=edit
Meta patch for r1889916 v3

Hopefully the final patch version. Dual meta evaluation as described in Bug
4549, nonexistent, disabled, timed out lookups are all considered unrun.

Some examples of passed tests from basic_meta2.t:

   # Non-existing rule
   # Should not hit, meta is evaled twice: (!0) && (!1)
   meta TEST_META_2 !NONEXISTINGRULE
   # Should hit, meta is evaled twice: (!0 || 0) && (!1 || 1)
   meta TEST_META_3 !NONEXISTINGRULE || NONEXISTINGRULE

   # Disabled rule, same as above
   body TEST_DISABLED /a/
   score TEST_DISABLED 0
   # Should not hit
   meta TEST_META_4 !TEST_DISABLED
   # Should hit
   meta TEST_META_5 !TEST_DISABLED || TEST_DISABLED

   # Unrun rule (due to local tests only), same as above
   askdns TEST_DISABLED2 spamassassin.org TXT /./
   # Should not hit
   meta TEST_META_6 !TEST_DISABLED2
   # Should hit
   meta TEST_META_7 !TEST_DISABLED2 || TEST_DISABLED2

   # Should not hit
   meta TEST_META_8 __FOO_1 + NONEXISTINGRULE == 2
   # Should not hit
   meta TEST_META_9 __FOO_1 + NONEXISTINGRULE + __FOO_2 == 2
   # Should hit (both eval checks are true thanks to >1)
   meta TEST_META_A __FOO_1 + NONEXISTINGRULE + __FOO_2 > 1

For reference some repeatable benchmarks checking 100 messages:

- 3.4 55s 155MB
- trunk 50s 168MB
- trunk.meta 56s 162MB

Slight speed loss from current trunk, but on par with 3.4. Memory usage did
drop a bit from ditching merging and other stuff.

Will commit in few days unless hear otherwise.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7735] Meta rules need to handle missing/unrun dependencies

2021-05-15 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7735

--- Comment #15 from Henrik Krohns  ---
Argh never mind the previous comment, brain freeze.. that specific example
works, as both evals are true, let's say DCC_CHECK is disabled

1 + 0 + 1 > 1
1 + 1 + 1 > 1

Any other scenario to consider?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7735] Meta rules need to handle missing/unrun dependencies

2021-05-15 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7735

--- Comment #14 from Henrik Krohns  ---
Ok I've finished the dual evaluation code, but I'm still wondering whether
timed out lookups should count as unrun rules.

Let's take this stock rule as example.

meta DIGEST_MULTIPLE  RAZOR2_CHECK + DCC_CHECK + PYZOR_CHECK > 1

This gets problematic even when considering disabled rules. If simply one of
these is not used/loaded, or lookup times out, it won't hit even if two of them
hit.

Maybe a tflag that allows unrun rules for that rule?

-- 
You are receiving this mail because:
You are the assignee for the bug.