[7.0] 1.8.4 Multiworker include resource bug
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenERP buildout recipe |
Fix Released
|
High
|
Unassigned |
Bug Description
Description
--------------
When running a 7.0 server with workers>1, each worker will crash when they spawn when they try to import resource.
What is happening is that when odoo/addons is included in the sys.path, when python tries to import resource in (openerp/
The reason this is a recipe bug, is that when running the buildout recipe, the start_openerp script will include odoo/addons to the sys.path. This inclusion causes the wrong library to be imported by multiworkers. When they spawn, they will repeatedly output the following error:
2014-07-15 22:18:57,027 12681 INFO ? openerp: OpenERP version 7.0
2014-07-15 22:18:57,027 12681 INFO ? openerp: addons paths: /opt/openerp7/
2014-07-15 22:18:57,027 12681 INFO ? openerp: database hostname: localhost
2014-07-15 22:18:57,027 12681 INFO ? openerp: database port: 5432
2014-07-15 22:18:57,027 12681 INFO ? openerp: database user: openerp7
2014-07-15 22:18:57,028 12681 WARNING ? openerp.
Ambiguous import: the OpenERP module `resource` is shadowed by another
module (available at /opt/openerp7/
To import it, use `import openerp.
2014-07-15 22:18:57,037 12686 INFO ? openerp.
2014-07-15 22:18:57,039 12687 INFO ? openerp.
2014-07-15 22:18:57,039 12686 ERROR ? openerp.
Traceback (most recent call last):
File "/opt/openerp7/
self.
File "/opt/openerp7/
soft, hard = resource.
AttributeError: 'module' object has no attribute 'getrlimit'
2014-07-15 22:18:57,040 12687 ERROR ? openerp.
Traceback (most recent call last):
File "/opt/openerp7/
self.
File "/opt/openerp7/
soft, hard = resource.
AttributeError: 'module' object has no attribute 'getrlimit'
2014-07-15 22:18:57,040 12688 INFO ? openerp.
2014-07-15 22:18:57,042 12689 INFO ? openerp.
2014-07-15 22:18:57,043 12688 ERROR ? openerp.
Traceback (most recent call last):
File "/opt/openerp7/
self.
File "/opt/openerp7/
soft, hard = resource.
AttributeError: 'module' object has no attribute 'getrlimit'
2014-07-15 22:18:57,043 12690 INFO ? openerp.
2014-07-15 22:18:57,045 12689 ERROR ? openerp.
Traceback (most recent call last):
File "/opt/openerp7/
self.
File "/opt/openerp7/
soft, hard = resource.
AttributeError: 'module' object has no attribute 'getrlimit'
2014-07-15 22:18:57,046 12690 ERROR ? openerp.
Traceback (most recent call last):
File "/opt/openerp7/
self.
File "/opt/openerp7/
soft, hard = resource.
AttributeError: 'module' object has no attribute 'getrlimit'
2014-07-15 22:18:57,047 12691 INFO ? openerp.
2014-07-15 22:18:57,050 12691 ERROR ? openerp.
How to reproduce
-------
Using 1.8.4 install using the git source for odoo
run start_openerp --workers=2
Expected output
-------------------
The start_openerp script doesn't append odoo/addons to the system path
Workers spawn without a fuss, importing the system library named resource and calling the existing getrlimit function
Actual output
----------------
The start_openerp script appends odoo/addons to the system path
Workers spawn, import the odoo module named resource (odoo/addons/
Related branches
Changed in anybox.recipe.openerp: | |
status: | Fix Committed → Fix Released |
It's weird that nobody has stumbled on this one before.
I've never been completely sure about these sys.path entries questions, as you can guess by reading comments in the relevant part of the code. Also we have a source of incertainty in that I'm not sure what you suggest isn't the contrary of another fix of the same kind (also related to non-namespacing in OpenERP past history).
So In short, I'd like to be cautious about this, because it'll require a lot of testing on our side
Anyway, thanks for the analysis
Now some questions :
- do you need a fix for this in the stable branch of the recipe ?
- did this use to work on an earlier version of the recipe ? If yes, please provide me with the version number, it'll help us browse the history and maybe detect if there was any reason for that sys.path entry in OpenERP 7