Multiple notifications sent

mikegull - January 22, 2007 - 18:48
Project:Notify
Version:5.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Description

Due to timing issues, notify can send multiple notifications to the same user, if cron runs again while the first notification pass is going out. Modified the _cron hook as follows:

function notify_cron() {
  if (variable_get('notify_lock', false)) {
                watchdog('notify', 'Notify is still locked!');
  } else {
          variable_set('notify_lock', true);
          if (time() - variable_get('notify_send_last', 0) > variable_get('notify_send', 86400)) {
                 _notify_send();
                 variable_set('notify_send_last', time());
          }
          variable_set('notify_lock', false);
  }
}

Please add back to the main code.

#1

RobRoy - January 26, 2007 - 21:47
Status:needs review» needs work

Could you roll a patch? That would help. Thanks.

See http://drupal.org/patch.

#2

beginner - July 8, 2007 - 11:29
Version:4.7.x-1.x-dev» 5.x-1.0

http://drupal.org/node/138165 is a duplicate of this one.

The notify module has started sending out notifications every single cron job on one of my web sites. I have installed the latest release (and dropped the previous table in order to install it cleanly) but it insists on sending out notification after notification of the same nodes. Previous behavior (in 4.7.x version) the notify module would notify only new node postings.

what is puzzling is that with D5, the core cron function has been improved, to avoid having multiple instances of cron running, thereby duplicating the job.

If this bug really still existed in D5, more people would have reported it.

@mikegull : do you still experience this problem with D5?
@Shane: do you?

#3

Benjamin Melançon - October 8, 2007 - 12:33
Version:5.x-1.0» 5.x-1.1

According to issue at 180052, multiple notifications still can occur.

#4

Rhino - October 10, 2008 - 10:06

I have multiple notifications on every cron run. Sometimes only two, sometimes as many as eight.

#5

RobertNelsonVance - November 19, 2008 - 06:37

I too have been experiencing similar issues as described at http://drupal.org/node/180052#comment-1108742

#6

jwatte - January 28, 2009 - 19:02

I think the logic is worse than that, unfortunately, and I think the proposed patch is just a band-aid.
I'm proposing a different patch.

 
 

Drupal is a registered trademark of Dries Buytaert.