[5.0] [trunk] ir.cron and its implementation use a busywait timer that consumes unnecessary resources
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) | Status tracked in Trunk | |||||
5.0 |
Fix Released
|
Undecided
|
Unassigned | |||
Trunk |
Fix Released
|
Low
|
Unassigned |
Bug Description
ir.cron is a netsvc.Agent and the setAlarm() method used to schedule tasks is implemented using python's threading.Timer which ultimately relies on a threading.
The issue is that threading.
This becomes a problem when a lot of Agent tasks (e.g. ir.cron tasks) are scheduled, because that creates as many threading.Condition as there are tasks, and the system resources can become impacted by the sum of all the little amounts of memory and CPU consumed.
This could become an important issue on large multi-tenant deployments...
An implementation based on real sleep() calls should be considered to avoid this.
Related branches
- Olivier Dony (Odoo): Approve
- Stephane Wirtel (OpenERP): Pending requested
-
Diff: 98 lines (+53/-18)1 file modifiedbin/netsvc.py (+53/-18)
Branch merged at 2123 <email address hidden> and forwardported at 2746 <email address hidden>