You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2018/10/01 13:47:04 UTC

svn commit: r1842500 - /spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Razor2.pm

Author: hege
Date: Mon Oct  1 13:47:04 2018
New Revision: 1842500

URL: http://svn.apache.org/viewvc?rev=1842500&view=rev
Log:
Fix razor_fork race with rulename. Little less debugging.

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Razor2.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Razor2.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Razor2.pm?rev=1842500&r1=1842499&r2=1842500&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Razor2.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Razor2.pm Mon Oct  1 13:47:04 2018
@@ -480,7 +480,7 @@ sub _check_forked_result {
   # if $finish, force waiting for the child
   my $pid = waitpid($kid_pid, $finish ? 0 : WNOHANG);
   if ($pid == 0) {
-    dbg("razor2: child process $kid_pid not finished yet, trying later");
+    #dbg("razor2: child process $kid_pid not finished yet, trying later");
     return 0;
   } elsif ($pid == -1) {
     # child does not exist?
@@ -586,11 +586,13 @@ sub check_razor2_range {
         [$engine, $min, $max, $rulename];
       return 0;
     }
-  }
-
-  # If Razor2 hasn't been checked yet, go ahead and run it.
-  if (!$pms->{razor2_running}) {
-    $self->check_razor2($pms, $body);
+  } else {
+    # If Razor2 hasn't been checked yet, go ahead and run it.
+    # (only if we are non-forking.. forking will handle these in
+    # callbacks)
+    if (!$pms->{razor2_running}) {
+      $self->check_razor2($pms, $body);
+    }
   }
 
   my $cf = 0;