← Back to team overview

openerp-india team mailing list archive

[Bug 1317598] [NEW] [SAAS-3] mass_mailing doesn't support mass mailings

 

Public bug reported:

The use of the 'mass_mailing' component to send messages to hundreds of
recipients works well but does not work if it is used to send messages
to tens of thousands of recipients.

We have tested the component to send an mail with and without
attachments using the wizard 'Contact Mass Mailing' to one hundred
thousand recipients and it does not work.( No stacktrace or error in the
log file or message created.)

By analyzing the code, it seems that the implementation of mass_mailing
in the current state can not support such use.

Here is a list of item that attracted my attention:
* in addons.mail.wizard.mail_compose_message:
  - Before the creation of the first mail_mail the function 'send_mail' compute all the email values in memory! 
        ...
         all_mail_values = self.get_mail_values(cr, uid, wizard, res_ids, context=context)
        ...
  - In the generation of the values that will be used by send_mail to create mail_messages or mail_mails by the function get_mail_values:
    1) for each recipient_id one by one in addons.email_template.wizard.mail_compose.render_message_batch we browse the recipent and the template is used to render fields=['email_to', 'partner_to', 'email_cc', 'attachment_ids', 'mail_server_id']. The result is kept in memory.
    2) for each recipient one by one in addons.mail.wizard.mail_compose_message.render_message_batch the values from the wizard are used to render fields=['email_from', 'subject', 'body', 'reply_to']. The result is kept in memory.
   - For each recipient, a mail.mail object is created using the generated informations from step 1 and step 2 in addons.mail.wizard.mail_compose_message.send_mail (in the creation process, for each attachment in the wizard form we crate a many to many entry to link the attachment to the mail.mail)

So, sending a mail with 1 attachment to 100.000 recipients insert about
200.000 rows in the databases and each additinal attachment requires
100.000 rows. The situation became worse when we use a template with
attachments which must be rendered...

The problems with the current implementation are:
* It is very memory-intensive 
* Everything is done in a very, very ,very large transaction
* It never ends when they are too many recipents

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1317598

Title:
  [SAAS-3] mass_mailing doesn't support mass mailings

Status in OpenERP Addons (modules):
  New

Bug description:
  The use of the 'mass_mailing' component to send messages to hundreds
  of recipients works well but does not work if it is used to send
  messages to tens of thousands of recipients.

  We have tested the component to send an mail with and without
  attachments using the wizard 'Contact Mass Mailing' to one hundred
  thousand recipients and it does not work.( No stacktrace or error in
  the log file or message created.)

  By analyzing the code, it seems that the implementation of
  mass_mailing in the current state can not support such use.

  Here is a list of item that attracted my attention:
  * in addons.mail.wizard.mail_compose_message:
    - Before the creation of the first mail_mail the function 'send_mail' compute all the email values in memory! 
          ...
           all_mail_values = self.get_mail_values(cr, uid, wizard, res_ids, context=context)
          ...
    - In the generation of the values that will be used by send_mail to create mail_messages or mail_mails by the function get_mail_values:
      1) for each recipient_id one by one in addons.email_template.wizard.mail_compose.render_message_batch we browse the recipent and the template is used to render fields=['email_to', 'partner_to', 'email_cc', 'attachment_ids', 'mail_server_id']. The result is kept in memory.
      2) for each recipient one by one in addons.mail.wizard.mail_compose_message.render_message_batch the values from the wizard are used to render fields=['email_from', 'subject', 'body', 'reply_to']. The result is kept in memory.
     - For each recipient, a mail.mail object is created using the generated informations from step 1 and step 2 in addons.mail.wizard.mail_compose_message.send_mail (in the creation process, for each attachment in the wizard form we crate a many to many entry to link the attachment to the mail.mail)

  So, sending a mail with 1 attachment to 100.000 recipients insert
  about 200.000 rows in the databases and each additinal attachment
  requires 100.000 rows. The situation became worse when we use a
  template with attachments which must be rendered...

  The problems with the current implementation are:
  * It is very memory-intensive 
  * Everything is done in a very, very ,very large transaction
  * It never ends when they are too many recipents

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1317598/+subscriptions


Follow ups

References