[Trunk/6.1] Infinite loop in procurement run by scheduler

Bug #1006778 reported by Yann Papouin
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Medium
OpenERP R&D Addons Team 2

Bug Description

New bug report only for 6.1 as the previous one (lp#918288) is set to invalid.

Steps to reproduce:

- Create new database WITHOUT demonstration data
- Log in as Administrator
- Install [SALES], [PURCHASE], [WAREHOUSE], [MRP]

[SALES]
Create a new product "Product A" and set:
- Product Type: Stockable Product
- Procurement Method: Make to Order
- Supply method : Produce

Create a new product "Product B" and set:
- Product Type: Stockable Product
- Procurement Method: Make to Order
- Supply method : Buy
- Create a new supplier and add it to the suppliers tab

[MANUFACTURING]
Create a new BOM for "Product A" and set:
- BoM Type: Sets / Phantom
- Add component "Product B" with quantity of 1.0

[PRODUCTS]
- Go to "Product A" form view in click on "Procurement Request" action
- Select main Warehouse an click on "Ask New Products"
- In the procurement form, click on "Run Procurement"

[WAREHOUSE]
Run schedulers manually with "Compute Schedulers"
- Click on "Compute Schedulers"
- Go to "Procurement Exceptions" and uncheck "To fix" in order to view everything

Expected:
=== USER POINT OF VIEW ===
- A new quotation is created for "Product B"

Result:
=== USER POINT OF VIEW ===
- Product A is locked in "Confirmed" state

=== SERVER POINT OF VIEW ===
A new python thread is stuck in an infinite loop "while True" in _procure_confirm (schedulers.py), if you debug the process you will see that:
- "offset" is never increased
- "report_total" is constantly increased

Thread-1004 - pid707_seq179
 execute [sql_db.py:222]
 wrapper [sql_db.py:152]
 _read_flat [orm.py:3465]
 read [orm.py:3406]
 __getitem__ [orm.py:391]
 __getattr__ [orm.py:476]
 get_phantom_bom_id [procurement.py:52]
 function_proxy [orm.py:368]
 <module> [server:1]
 safe_eval [safe_eval.py:241]
 _eval_expr [wkf_expr.py:58]
 check [wkf_expr.py:81]
 _split_test [workitem.py:158]
 process [workitem.py:61]
 validate [instance.py:48]
 trg_validate [wkf_service.py:124]
 _procure_confirm [schedulers.py:82]
 run_scheduler [schedulers.py:39]
 _procure_calculation_all [schedulers_all.py:52]
 run [threading.py:484]
 __bootstrap_inner [threading.py:532]
 __bootstrap [threading.py:504]

Tags: procurement
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hello,

I confirm this issue.
I encountered it without knowing exactly how to reproduce it with a scenario, so I'm grateful to see your clean scenario.
But I also found the same conclusion than your "server point of view" chapter.

Thanks
Guewen

Revision history for this message
Amit Bhavsar (Open ERP) (amb-openerp) wrote :

Hello Yann Papouin,

I have tested your scenario, I have face the same problem. also I am check the scenario another way,,,,
Lets see,
First, I confirm the S.O for the "product A". and than I check the procurement exceptions. For "product A", procurement status is waiting. where sub product B procurement status is running.
So it's definitely problem. That's why I am confirm this Issue with medium Importance.

Thanks for the reporting!

Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
summary: - [6.1] Infinite loop in procurement run by scheduler
+ [Trunk/6.1] Infinite loop in procurement run by scheduler
Amit Parik (amit-parik)
tags: added: procurement
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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