v5.0.0/Mac Crash on db connection close
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) | Status tracked in Trunk | |||||
5.0 |
Fix Released
|
High
|
Christophe Simonis (OpenERP) | |||
Trunk |
Fix Released
|
High
|
Christophe Simonis (OpenERP) |
Bug Description
I'm running the server on Mac OS X Leopard 10.5.6, using python 2.5 provided by the system and a few other modules I compiled myself.
Trying to connect to the data base raises the following error
INFO:web-
INFO:dbpool:
INFO:dbpool:Closing all connections to template1
Closing connection <connection>
Bus error
I tried with previous versions and it works with v5 RC1 which still used psycopg (1).
With RC2, psycopg2 has been used and the code of sql_db.py has been changed too.
Debugging, it seems that the "wrapper" method from sql_db.py is called over and over, leading to a stack overflow and an app crash.
def check(f):
from tools.func import wraps
@wraps(f)
def wrapper(self, *args, **kwargs):
if not hasattr(self, '_obj'):
return f(self, *args, **kwargs)
return wrapper
Related branches
Changed in openobject-server: | |
status: | New → Confirmed |
Changed in openobject-server: | |
assignee: | fabian-openerp → fp-tinyerp |
I just patched sql_db.py.
I know it's an horrible fix, it raises exceptions, but it breaks the infinite loop.
I hope that will help the OpenERP Team to make a better fix.
@wraps(f) name==' __getattr_ _' and args==('_obj',)) and not hasattr(self, '_obj'):
raise psycopg2. ProgrammingErro r('Unable to use the cursor after having closing it')
def wrapper(self, *args, **kwargs):
- if not hasattr(self, '_obj'):
+ if not (f.func_
return f(self, *args, **kwargs)
return wrapper
@check
def __getattr__(self, name):
- return getattr(self._obj, name)
+ if name!='_obj':
+ return getattr(self._obj, name)
+ else:
+ return None