I see intermittent content get posted with quite invalid node values (not sure why Drupal code accepted content that was missing a required taxonomy value), and when it gets to the spam module, it reports a FIXME: looping error, from spam_mark_as_spam.

That function has a TODO saying FIXME, and I was wondering if someone could give me hints on what would be one way to fix this. I just want to avoid the spam getting published when this happens, and am ok with taking a risk in marking non-spam as spam in this specific case.

Here are some snippets of spam log, debug level:

node 890 2009-01-06 12:28 FIX ME: looping
node 890 2009-01-06 12:28 current score(9900) current total(100) average(99)
node 890 2009-01-06 12:28 Duplicate filter: total(99) redirect(duplicate/denied/post)

trace:
node 890 2009-01-06 12:28 _spam_log_trace --
node 890 2009-01-06 12:28 spam_content_insert inserting
node 890 2009-01-06 12:28 spam_content_filter invoking content filters
node 890 2009-01-06 12:28 spam_content_filter invoking Duplicate filter [1], gain = 100

Comments

bwooster47’s picture

More confusing log lines!
Looks like spam module took 11 minutes to process one node - 884 below? And it is interspersed with node 890 which was wrongly handled.

node 891 2009-01-06 12:39 Duplicate filter: total(99) redirect(duplicate/denied/post) gain...
node 891 2009-01-06 12:39 Duplicate filter: total(99) redirect(duplicate/denied/post) gain...
node 884 2009-01-06 12:39 unpublished
node 884 2009-01-06 12:39 marked as spam, score(99)
node 891 2009-01-06 12:39 inserting
node 891 2009-01-06 12:39 --
node 890 2009-01-06 12:28 FIX ME: looping
node 890 2009-01-06 12:28 current score(9900) current total(100) average(99)
node 890 2009-01-06 12:28 Duplicate filter: total(99) redirect(duplicate/denied/post) gain...
node 884 2009-01-06 12:28 unpublished
node 884 2009-01-06 12:28 update token(blogspot.com) class(url) yes(75) no(0) prob(99): ad...
node 884 2009-01-06 12:28 mark_as_spam
node 884 2009-01-06 12:28 update token(datingblogspotcom) class(spam) yes(36) no(0) prob(9...
....

kjl’s picture

look at lines 1714 - 1719 in spam module.

You might try commenting out the "return". There's no indication what the source of the unwanted loop is, or if it has been fixed already, so there may be unforeseen results from changing this.

bwooster47’s picture

I fixed it by allowing it to look more than once, using 10 just in case.

Here's the changed function:


function spam_mark_as_spam($type, $id, $extra = array()) {
  // TODO: Fix this loop
  // XXX: this seems to get called multiple times for certain nodes, so allowing
  // to loop for N times
  static $loop = 10;
  if ($loop < 0) {
    spam_log(SPAM_DEBUG, 'spam_mark_as_spam', t('FIX ME: looping'), $type, $id);
    return;
  }
  $loop--;
 
  spam_update_statistics(t('@type marked as spam', array('@type' => $type)));
...
jeremy’s picture

Assigned: Unassigned » jeremy
Status: Active » Postponed (maintainer needs more info)

We need to better understand why we're looping in the first place...

jeremy’s picture

One instance of this I tracked down to marking multiple comments as spam/not spam via the admin interface. The kludge-anti-loop logic was blocking this as it considered it a loop. This has been fixed.

gnassar’s picture

Jeremy, should this be closed, or had you seen other instances of the problem that haven't been explained yet?

jeremy’s picture

I have seen this in the logs recently, but I've not dug into it any further yet. I think this still needs to stay open.

gnassar’s picture

Status: Postponed (maintainer needs more info) » Active
gnassar’s picture

Status: Active » Postponed (maintainer needs more info)

Again, haven't seen this recently -- is this still popping up for you?

(Figured a year was long enough to mark it back down to "postponed") :)

jeremy’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I've not seen this for quite a while, let's go ahead and close it.