openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #19036
[Bug 1086396] [NEW] the process_email_queue scheduled task sends mail twice, on mass-mailing
Public bug reported:
Hello,
we discovered that the "mail" addon is sending some messages twice.
This is because the cron task "commits" the cursor after each message,
and it releases the lock which was acquired on "ir_cron" table.
# Try to grab an exclusive lock on the job row from within the task transaction
"SELECT * FROM ir_cron WHERE id=%s FOR UPDATE NOWAIT"
So the same cron will be launched again without waiting the end of the
previous one. and the "search" will grab some mail.messages which are
already processed by the first job.
We just sent some thousands of e-mails, and we had few of them which
were sent twice.
The fix should be simple: do not use the main cursor to send the
e-mails.
** Affects: openobject-addons
Importance: Undecided
Status: New
** Project changed: openobject-server => openobject-addons
** Description changed:
Hello,
we discovered that the "mail" addon is sending some messages twice.
This is because the cron task "commits" the cursor after each message,
and it releases the lock which was acquired on "ir_cron" table.
- # Try to grab an exclusive lock on the job row from within the task transaction
- "SELECT * FROM ir_cron WHERE id=%s FOR UPDATE NOWAIT"
+ # Try to grab an exclusive lock on the job row from within the task transaction
+ "SELECT * FROM ir_cron WHERE id=%s FOR UPDATE NOWAIT"
So the same cron will be launched again without waiting the end of the
- previous one. and the "search" with grab some mail.messages which are
+ previous one. and the "search" will grab some mail.messages which are
already processed by the first job.
We just sent some thousands of e-mails, and we had few of them which
were sent twice.
The fix should be simple: do not use the main cursor to send the
e-mails.
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/1086396
Title:
the process_email_queue scheduled task sends mail twice, on mass-
mailing
Status in OpenERP Addons (modules):
New
Bug description:
Hello,
we discovered that the "mail" addon is sending some messages twice.
This is because the cron task "commits" the cursor after each message,
and it releases the lock which was acquired on "ir_cron" table.
# Try to grab an exclusive lock on the job row from within the task transaction
"SELECT * FROM ir_cron WHERE id=%s FOR UPDATE NOWAIT"
So the same cron will be launched again without waiting the end of the
previous one. and the "search" will grab some mail.messages which are
already processed by the first job.
We just sent some thousands of e-mails, and we had few of them which
were sent twice.
The fix should be simple: do not use the main cursor to send the
e-mails.
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1086396/+subscriptions
Follow ups
-
[Bug 1086396] Re: ir.cron's lock is discarded by scheduled jobs performing batch transactions, wreaking havoc
From: Serpent Consulting Services, 2012-12-24
-
[Bug 1086396] Re: ir.cron's lock is discarded by scheduled jobs performing batch transactions, wreaking havoc
From: Olivier Dony (OpenERP), 2012-12-22
-
[Bug 1086396] Re: ir.cron's lock is discarded by scheduled jobs performing batch transactions, wreaking havoc
From: Launchpad Bug Tracker, 2012-12-22
-
[Bug 1086396] Re: ir.cron's lock is discarded by scheduled jobs performing batch transactions, wreaking havoc
From: Olivier Dony (OpenERP), 2012-12-04
-
[Bug 1086396] Re: the process_email_queue scheduled task sends mail twice, on mass-mailing
From: Olivier Dony (OpenERP), 2012-12-04
-
[Bug 1086396] [NEW] the process_email_queue scheduled task sends mail twice, on mass-mailing
From: Florent, 2012-12-04
References