Improper cronjobs?

Bug #493544 reported by milosh
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Invalid
Undecided
Unassigned
Power Email
Incomplete
Undecided
Sharoon Thomas http://openlabs.co.in

Bug Description

I have had continously problems with Poweremail module, which I presume are related to cronjob part of the Poweremail

Description of the problem:

1) All sent e-mail stay at outbox for forever after Powermail module installation. I note that there is a regular poweremail task to run a cron once every hour and all other regular tasks run, but no emails are ever sent out.

2) If I log out from Openerp database and/or restart openerp-server afterwards, the OpenERP is not reachable anymore (the server is working, but does not give the list of databases to OpenERP client). The main technical reason is, that the OpenERP becomes stuck with too many idle (at least 30-50) postgresql connections, so the postgresql database pool becomes eventually exhausted. Moreover, restarting openerp-server or postgresql does not close down these idle connections (that can stay for hours and days).

The only solution to revert back to working installation of OpenERP is 1) reboot the machine to clean up the postgresql mess as restarting postgresql service or killing postgresql process does not kill idle connections; 2) delete manually Poweremail related cronjob from ir.cron postgresql table before starting openerp-server; 3) start openerp-server (now OpenERP becomes reachable) and enter poweremail cronjob manually. 4) If one tries to connect OpenERP before deleting Poweremail related cronjob from ir.cron, then the postgresql database pool becomes again exhausted.

The problem has been present in two different servers (one under Ubuntu and one under RedHat) and is not related with the way I have installed a Poweremail. The plain new installation under fresh OpenERP or updating existing Poweremail installation with new version or uninstalling old version and installing new version of Poweremail have all yielded into the same result -- leaking postgresql connections that can be dealt only by manually deleting the poweremail related line in ir.cron table.

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote :

Can you paste a screenshot of your poweremail scheduler setting here?

You can get it from Admin > Configuration > Scheduled Actions

Changed in poweremail:
assignee: nobody → Sharoon Thomas (sharoonthomas)
Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote :

A note here:

The default cron job that gets installed with the module is not an infinite job.
To make it infinite you have to go to the above mentioned menu and make the number of times it has to run to -1

Changed in poweremail:
status: New → Incomplete
Revision history for this message
milosh (raoul-hot) wrote :

Hi!

It is not so much a bug of PowerEmail after all, but a "feature" of OpenERP.

The problem stems from the way OpenERP handles cronjobs. Basically -- if you by mistake set the next runtime of the cronjob to run in past, then you are doomed. OpenERP is not able to handle the cron anymore and crashes. When you try to reconnect, OpenERP literally explodes into your postgresql connection pool, so the later is immediatelly exhausted (and you may need to "kill -9 pid" the openerp-server from terminal command to restart your openerp).

The only way to revert back to working copy of OpenERP is:

1) remove problematic lines from ir_cron table in your database
2) restart openerp-server
3) reconnect to database

So one needs a shell access to the server to clean up the mess, which makes it not so funny at all... :(

Anyway, the only thing PowerEmail can probably do about it is to take extra care about the way PowerEmail cronjobs are handled, because it seemed to me, that in my case the next cron time expired before it was run (I don't know why exactly this happened, because in general OpenERP crons work)

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote :

I agree with you and i have joined this bug to the openobject-server.

I am pretty sure what the response will be.... anyway lets wait and watch.

I confirm this as a bug and we are seriously limited.

Poweremail patching this may affect some modules like mrp or for that reason even sale (a god forbid relation of a scheduler to sales process).

I request tiny's attention on this....

I remember a previous post by Ferdinand about a command line argument to stop these cron jobs from running. not sure they accepted it either..

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote : Re: [Bug 493544] Re: Improper cronjobs?
Download full text (3.3 KiB)

Guys,

Looks like Tiny is aware of serious issues with their connection pool.
Otherwise, Antony Lesuisse who do have a lot of other things to work with at
Tiny wouldn't himself create that fix branch:
https://code.launchpad.net/~al-openerp/openobject-server/5.0_sqldbcleanup

Now, I'm not sure if that fixes that specific bug and/or could be merged
back in 5.0 (I doubt).

Good luck with that one.

Raphaël Valyi
http://www.akretion.com

On Wed, Feb 10, 2010 at 9:02 PM, Sharoon Thomas
<email address hidden>wrote:

> I agree with you and i have joined this bug to the openobject-server.
>
> I am pretty sure what the response will be.... anyway lets wait and
> watch.
>
> I confirm this as a bug and we are seriously limited.
>
> Poweremail patching this may affect some modules like mrp or for that
> reason even sale (a god forbid relation of a scheduler to sales
> process).
>
> I request tiny's attention on this....
>
> I remember a previous post by Ferdinand about a command line argument to
> stop these cron jobs from running. not sure they accepted it either..
>
> --
> Improper cronjobs?
> https://bugs.launchpad.net/bugs/493544
> You received this bug notification because you are subscribed to
> OpenObject Server.
>
> Status in OpenObject Server: New
> Status in Power e-Mail for Open ERP: Incomplete
>
> Bug description:
> I have had continously problems with Poweremail module, which I presume are
> related to cronjob part of the Poweremail
>
> Description of the problem:
>
> 1) All sent e-mail stay at outbox for forever after Powermail module
> installation. I note that there is a regular poweremail task to run a cron
> once every hour and all other regular tasks run, but no emails are ever sent
> out.
>
> 2) If I log out from Openerp database and/or restart openerp-server
> afterwards, the OpenERP is not reachable anymore (the server is working, but
> does not give the list of databases to OpenERP client). The main technical
> reason is, that the OpenERP becomes stuck with too many idle (at least
> 30-50) postgresql connections, so the postgresql database pool becomes
> eventually exhausted. Moreover, restarting openerp-server or postgresql does
> not close down these idle connections (that can stay for hours and days).
>
> The only solution to revert back to working installation of OpenERP is 1)
> reboot the machine to clean up the postgresql mess as restarting postgresql
> service or killing postgresql process does not kill idle connections; 2)
> delete manually Poweremail related cronjob from ir.cron postgresql table
> before starting openerp-server; 3) start openerp-server (now OpenERP becomes
> reachable) and enter poweremail cronjob manually. 4) If one tries to connect
> OpenERP before deleting Poweremail related cronjob from ir.cron, then the
> postgresql database pool becomes again exhausted.
>
>
> The problem has been present in two different servers (one under Ubuntu and
> one under RedHat) and is not related with the way I have installed a
> Poweremail. The plain new installation under fresh OpenERP or updating
> existing Poweremail installation with new version or uninstalling old
> version and installing new version of Powerema...

Read more...

Changed in openobject-server:
status: New → Invalid
Revision history for this message
Joan Arus (joanarus) wrote :

Hi there!

I have got the same problem. Emails will stay in the Outbox folder but never get sent.

I've checked the Admin > Configuration > Scheduled Actions > Poweremail scheduler and the number of times is set to 0.

It doesn't even sent when clicking "send now".

Anybody knows what can I do to make it work?

Thanks!

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote :

@Joan Arus,

Your problem is different.

If you want the mails to be sent infinitely then the number of times should be a -ve number say -1.

it will not send if its 0.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.