In Warehouse : When Run The Copmpute Schedular :

Bug #865956 reported by Amit Bhavsar (Open ERP)
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 2

Bug Description

Problem : In Warehouse : When Run The Copmpute Schedular :
            Warehouse --> Schedular --> Compute Schedular .
             Find out traceback at servar Side :
            ============================================================
             Traceback (most recent call last):
              File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
                self.run()
              File "/usr/lib/python2.6/threading.py", line 484, in run
                self.__target(*self.__args, **self.__kwargs)
              File "/home/amb/source/addons/trunk/procurement/wizard/schedulers_all.py", line 48, in _procure_calculation_all
                proc_obj.run_scheduler(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname,\
              File "/home/amb/source/server/trunk/openerp/osv/orm.py", line 456, in __getattr__
                return self[name]
              File "/home/amb/source/server/trunk/openerp/osv/orm.py", line 369, in __getitem__
                field_values = self._table.read(self._cr, self._uid, ids, field_names, context=self._context, load="_classic_write")
              File "/home/amb/source/server/trunk/openerp/osv/orm.py", line 3197, in read
                result = self._read_flat(cr, user, select, fields, context, load)
              File "/home/amb/source/server/trunk/openerp/osv/orm.py", line 3256, in _read_flat
                cr.execute(query, (tuple(sub_ids),))
              File "/home/amb/source/server/trunk/openerp/sql_db.py", line 152, in wrapper
                raise psycopg2.OperationalError(msg)
            OperationalError: Unable to use a closed cursor.

Tags: rc1

Related branches

affects: openobject-server → openobject-addons
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Low
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Changed in openobject-addons:
status: In Progress → Confirmed
affects: openobject-addons → openobject-server
Changed in openobject-server:
assignee: OpenERP R&D Addons Team 2 (openerp-dev-addons2) → OpenERP's Framework R&D (openerp-dev-framework)
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

After digging a bit in detail I found that the problem is from the procurements/wizard/schedulers_all.py @line 61
The code *threaded_calculation.start()* i.e the thread is started by using *start* method which will arrange for the object’s run() method to be invoked in a separate thread of control. and will execute the next statement but will not call the "Callable" from its args. so the *cr* (cursor) arg passed to the callable will be closed before the thread actually calls the method.

A workaround is to user thread.run() so that the method is called before the cursor object gets closed.

Correct me if I am missing something !

@community Team: please re change the project :)

Thanks,

Amit Parik (amit-parik)
affects: openobject-server → openobject-addons
Changed in openobject-addons:
assignee: OpenERP's Framework R&D (openerp-dev-framework) → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Low → Medium
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Atik Agewan(OpenERP) (aag-openerp) wrote :

Hello,

It has been fixed in lp:~openerp-dev/openobject-addons/trunk-bug-865956-aag
Revision ID: <email address hidden>
Revision num: 5371.
It will be available in trunk soon,

Thanks,
Atik Agewan

Changed in openobject-addons:
status: In Progress → Fix Committed
tags: added: rc1
Revision history for this message
qdp (OpenERP) (qdp) wrote :

fix released in revision 5385. Beware that the applied patch is different that the (rejected) merge proposal.

Thanks,
Quentin

Changed in openobject-addons:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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