CiviMail - Find and fix any missing recipients - #36430
Conversation
|
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
PR commands & links...
|
| WHERE mr.mailing_id = %1 | ||
| AND queue.email_id IS NULL AND queue.phone_id IS NULL | ||
| AND (mr.email_id > 0 OR mr.phone_id > 0) | ||
| AND mr.contact_id > 0 |
There was a problem hiding this comment.
should add mj.is_test = 0 and I would also just flag that we might need to join onto contact becuase when the jobs queue items it calls this function https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/BAO/MailingJob.php#L423 which does a final check in case a contact has opted out since the mailing started running https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/BAO/MailingRecipients.php#L62
It has been reported that some recipients may be silently skipped during large CiviMail dispatches. The "why" is unclear, it may be due to deadlocks or concurrency issues. This adds a stopgap to ensure these irregularities are caught, fixed, and hopefully people will report them and help us track down the root cause. See https://lab.civicrm.org/dev/core/-/work_items/6678
e045539 to
c058d04
Compare
| 'mailing_id' => $mailingID, | ||
| 'job_type' => 'child', | ||
| 'parent_id' => $parentJobID, | ||
| 'job_offset' => $maxOffset + 1000, |
There was a problem hiding this comment.
@colemanw just wondering where does the 1000 come from? Should this reference the mailing batch size?
There was a problem hiding this comment.
That's a really good question! I don't know; it was in the original NYSS patch:
Is there a variable we should use instead?
There was a problem hiding this comment.
I was thinking maybe this setting https://github.com/civicrm/civicrm-core/blob/master/ext/civi_mail/settings/Mailing.setting.php#L237 as i think the Job_offset is calculated by reference to the mailerBatchLimit iirc
|
Is this the function we should use? $nextOffset = (int) CRM_Mailing_BAO_MailingRecipients::mailingSize($mailingID); |
Overview
It has been reported that some recipients may be silently skipped during large CiviMail dispatches. The "why" is unclear, it may be due to deadlocks or concurrency issues. This adds a stopgap to ensure these irregularities are caught, fixed, logged, and hopefully people will report them and help us track down the root cause.
See https://lab.civicrm.org/dev/core/-/work_items/6678