same notifications being sent every time cron runs

Jeremy - November 9, 2009 - 18:00
Project:Notifications
Version:6.x-2.1
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I recently upgraded a client website, migrating MySQL from running on the same server as Apache to running on a dedicated server. After this migration, users of the website have started receiving the same notifications over and over every time cron runs. Mails are still being sent from the same server as they were before the migration, the only difference is that now Drupal is talking to a remote database server. Everything else seems to work correctly.

As far as I understand it so far, notifications_process_queue() is being called from notifications_process_run() which is getting called by notifications_cron(), and it is sending out the notification emails without problem. However, notifications_queue_done($batch); is not getting called and so the next time cron runs the same batch is processed again. This suggests that if ($processed && !$test && !$update) is evaluating to FALSE.

My above statement may be incorrect, however, as each time cron runs I do see the number of notifications in the queue decreasing. Regardless, the same notifications are sent to the same users repeatedly each time cron runs.

I'm looking for any tips on how to best debug this? Due to the steadily growing number of repeat notifications being sent out we have had to temporarily disable notifications completely, making debugging even more difficult.

#1

Jeremy - November 9, 2009 - 18:18

I should add, we are using the following notifications modules:

  • Content Notifications 6.x-2.1
  • Notifications 6.x-2.1
  • Notifications Autosubscribe 6.x-2.1
  • Notifications Lite 6.x-2.1
  • Notifications UI 6.x-2.1
  • Taxonomy Notifications 6.x-2.1
  • Organic Groups Notifications 6.x-2.0
  • Privatemsg Email Notification 6.x-1.x-dev

We're also using the 6.x-2.1 Messaging modules.

#2

Jeremy - November 9, 2009 - 18:43
Title:notifications sent but notifications_queue not updated» same notifications being sent every time cron runs

Updating title. Old title may not have been correct.

#3

Jeremy - November 11, 2009 - 16:38

In addition to the same notifications being sent repeatedly each time cron runs (though only for a few hours per notification), the same notification is also being sent multiple times during each cron run. So the same notification will be sent 8-15 times for 1-3 hours each time cron runs. Any hints or suggestions as to what may be causing this simply from migrating the database server would be greatly appreciated.

#4

mzenner - November 11, 2009 - 18:39

I have the same problem, some users get duplicate messages

SELECT COUNT( * ) , body, uid, FROM_UNIXTIME( sent )
FROM messaging_store
GROUP BY body
HAVING count( * ) >1

Gives me several duplicate messages to a user.
Same setup as Jeremy (remote db, same versions)

#5

Scott Reynolds - November 11, 2009 - 18:54

subscribe. Just updating from Notifications 1.x.

#6

Jeremy - November 11, 2009 - 21:59

I believe I have finally tracked this down, in our case. Calls to update the 'variables' cache in the variable table were failing as the max_allowed_packet on the new server was set to a default of 1M. We have increased this variable on the MySQL server, though a cleanup of unnecessary variables is also in order.

#7

Scott Reynolds - November 11, 2009 - 22:39
Status:active» fixed

ahh interesting. another funny Drupal quirk. Thanks for sharing.

#8

Jeremy - November 12, 2009 - 18:46

I'm just posting confirmation now that there's been more testing that increasing max_allowed_packet on the remote MySQL server did indeed solve this issue.

For example, to increase to 32M you can add the following to my.cnf:
max_allowed_packet = 32M

And to make the change on the running server without restarting MySQL you can use the following command:
mysql> SET GLOBAL max_allowed_packet=33554432;

#9

Jose Reyero - November 13, 2009 - 11:24

Hi Jeremy,

Thanks for sharing.

I think this is a very interesting issue, extremely difficult to track down and may be affecting other sites too, so it would be great if you could post a summary of this to the Drupal core issue tracker as a generic task, like 'Keep the variables table clean/small'

#10

System Message - November 27, 2009 - 11:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.