Heratic behavior of the cron system

Asked by Jonathan Liuti

Hello,

I'm having some trouble with the cron pool on one of my install.
It seems some of my tasks, even though they are set to be rescheduled if missed, ain't rescheduled everytime...
And then they are executed quite randomly now and then ...

This is especially annoying because I use the smtpclient module which is based on the execution of cron task to process the email queue.

It seems to be reliable on one of my install and not on the others (reliable= ubuntu desktop 10.10 , not reliable= ubuntu server 10.04). Both use the exact same version of openerp. Both system are ntp synch btw.

Is there something that could mess with the cron pool that I'm not aware of ?

Thx,
John.

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Numérigraphe (numerigraphe) said :
#1

In v5 the openerp cron is only active when there is a client interacting with the server. I don't know for sure but maybe it's the same in v6. Maybe that's the cause your problem ?
Lionel

Revision history for this message
Ferdinand (office-chricar) said :
#2
Revision history for this message
Jonathan Liuti (liuti-john) said :
#3

Well it felt like the opposite to me. It seemed to work during this night without anybody touching that server (task are rescheduled correctly).

When I'm using the gtk client and looking at my server log in debug level i can see cron_pool executing each seconds.

So I know that the pool process is running in both cases but it's not doing its job for some reason...

Revision history for this message
Gerhard Könighofer (gerhard-koenighofer) said :
#4

"each second" is definitely strange, the highest frequency should be "each minute".
For the smtpclient module you don't need the "repeat missed" - on the contrary: it makes things worse.

Revision history for this message
Jonathan Liuti (liuti-john) said :
#5

@Gerhard,

Cron_pool debug log is outputed each second, thats what I see when I tail my server log.

Repeat missed may indeed be ignored but this doesnt change the main issue of cron behaving oddly.

@Ferdinand,

I can't say for sure its the same problem I encounter because I don't what's the expected behavior of the cron pool. What is the "regular" cron pool execution ? I need to set some sort of tracelog in my function to be sure its executed once or more than once, i'll do that test asap.

Revision history for this message
Gerhard Könighofer (gerhard-koenighofer) said :
#6

The undefined behavior of ir_cron is exactly the point described in (already mentionned) https://bugs.launchpad.net/openobject-server/+bug/715418

Executive Summary: the current implementation of ir_cron tries (partially without success) to avoid concurrency, which leads to totally unpredictable execution behavior. Neither start-times nor execution-intervals are guaranteed.

Can you help with this problem?

Provide an answer of your own, or ask Jonathan Liuti for more information if necessary.

To post a message you must log in.