My Drupal site was sending out repeat notifications every single time cron ran starting June 7th. I eventually just disabled the module, but recently I went digging through the code and log files to find out what was going on. It turns out that the 'notify_send_last' Drupal variable was never being updated, and I confirmed this was because of _notify_send() was repeatedly timing out based on the server limits. _notifiy_send() was consistently exceeding the default 30 seconds, timing out cron.php, then repeating itself on the next cron run since it never finished and never updated 'notify_send_last'.

I upped the limit from 30 seconds to 120 seconds on the virtual server... but it timed out *again*. I've upped the limit once more, but it seems like there must be a better behaviour for the module here.

First, maybe something changed in our June 7th update, and _notify_send() is taking way too long to complete (more than two minutes?). Let me know if you need more information here... I've got 239 rows in my 'dp_notify' table, this has happened first on a triple node update, but now on just a single node update. It seems to me like _notify_send() should not be taking more than two minutes to notify a few dozen users about a single node update...

Second, the default behaviour of notify_cron() seems quite prone to this error. Since there's only one timestamp, and it only ever gets updated if all notifications are sent successfully, it's groundhog day when a failure occurs halfway through and it just repeats this partial-notify-then-timeout every single cron run.

Might it be better if there were a timestamp per user, maybe? So that on partial-notify-then-timeout, the second cron job would pickup where notify_cron() left off, and so on each cron job until finished (rather than just repeating the first half of the list, spamming those users repeatedly, and never getting to the second half)?

Otherwise, it seems likely that many web servers don't let cron.php run for long periods of time, like120 second or more... I wonder if this is responsible for some of the other 'repeated notifications' bugs, because it's hard to track down why these notifications are repeating.

Happy to provide more information on my set up if it would help... I'm familiar with Drupal module development, but not too familiar with the notify code base beyond tinkering with notify_cron() and _notify_send() to confirm the cause of this problem.

Status

This is a duplicate of a lot of other bug reports (see Parent issue and Related issues to the right).

This bug has been fixed in the 7.x-branch and need to be backported to the the 6.x branch.

Comments

gisle’s picture

Issue summary: View changes

Fixed typo: changed 'notify_last_sent' to 'notify_send_last' after double-checking notify_cron() code.

gisle’s picture

Issue summary: View changes
gisle’s picture

Status: Active » Closed (outdated)

Fixed in the D7 version. D6 version no longer supported. Closing as "outdated".