Openbravo Issue Tracking System - Modules
View Issue Details
0047551ModulesAdvanced Warehouse Operationspublic2021-08-13 14:102021-09-23 13:25
lbressan 
vmromanos 
highmajoralways
closedfixed 
5
 
 
0047551: Generate picking process can be launched twice in parrallel -> this generates two picking tasks for certain items
If we launch the picking process in parallel, repeated picking tasks are generated for certain items
Login with two users
Isolate a big order (1000 lines )
both users click generate picking at the same time
the system will generate certain tasks double
No tags attached.
has duplicate defect 0048053 closed vmromanos Openbravo ERP Sales Order Lines Picking window can be opened on multiple tabs simultaneously 
causes defect 0047730 closed vmromanos Modules The replenishment priority is not respected 
Issue History
2021-08-13 14:10lbressanNew Issue
2021-08-13 14:10lbressanAssigned To => Triage Finance
2021-08-25 12:44lbressanNote Added: 0131351
2021-08-31 07:25ranjith_qualiantech_comAssigned ToTriage Finance => ranjith_qualiantech_com
2021-09-02 09:32ranjith_qualiantech_comStatusnew => scheduled
2021-09-07 05:47hgbotNote Added: 0131585
2021-09-10 14:45lbressanNote Added: 0131711
2021-09-16 16:35vmromanosAssigned Toranjith_qualiantech_com => vmromanos
2021-09-16 16:35hgbotNote Added: 0131876
2021-09-16 17:21vmromanosNote Added: 0131877
2021-09-16 17:46hgbotNote Added: 0131878
2021-09-17 13:09hgbotResolutionopen => fixed
2021-09-17 13:09hgbotStatusscheduled => closed
2021-09-17 13:09hgbotNote Added: 0131902
2021-09-17 13:09hgbotNote Added: 0131903
2021-09-21 12:00vmromanosRelationship addedcauses 0047730
2021-09-23 13:25eugeniIssue Monitored: eugeni
2021-11-15 14:08vmromanosRelationship addedrelated to 0048053
2021-11-15 15:11vmromanosRelationship replacedhas duplicate 0048053
2022-09-06 17:18caristuCategoryAdvance Warehouse Operations => Advanced Warehouse Operations

Notes
(0131351)
lbressan   
2021-08-25 12:44   
any update??
(0131585)
hgbot   
2021-09-07 05:47   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations/-/merge_requests/31 [^]
(0131711)
lbressan   
2021-09-10 14:45   
any news?
(0131876)
hgbot   
2021-09-16 16:35   
Merge request closed: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations/-/merge_requests/31 [^]
(0131877)
vmromanos   
2021-09-16 17:21   
Test plan (requires an Eclipse environment already configured) I:

Login in the backoffice as AWO-QA Admin
Create a new Purchase Order with two lines. Book it.
In Eclipse set two breakpoints in:
- InventoryTransactionTypeAlgorithm.java, line 247 (in the call to the init method)
- TaskGenerator.java, line 102 (in the flush after the call to the createTask method)
Press the Receive button and continue the execution till the first stop of the TaskGenerator breakpoint (a task has been generated already at this point).
Login in a different browser and open the same purchase order.
Press the Receive button.
Verify the InventoryTransactionTypeAlgorithm's breakpoint is not reached yet due to the lock.
Continue the execution of the previous thread till the completion. Two tasks are created.
Now realize the InventoryTransactionTypeAlgorithm's breakpoint is activated. This is the execution of the second reception.
Continue with the execution.
Verify the second reception process does not generate any task (because they were generated by the first run).


Test plan (requires an Eclipse environment already configured) II:

Login in the backoffice as AWO-QA Admin
Create a new Purchase Order with two lines. Book it.
In Eclipse set two breakpoints in:
- InventoryTransactionTypeAlgorithm.java, line 247 (in the call to the init method)
- TaskGenerator.java, line 102 (in the flush after the call to the createTask method)
Press the Receive button and continue the execution till the first stop of the TaskGenerator breakpoint (a task has been generated already).
Login in a different browser and create a new purchase order.
Press the Receive button.
Verify the InventoryTransactionTypeAlgorithm's breakpoint is reached, because the previous lock in the previous sales order doesn't affect this one.
Continue the two threads till the end.
Verify the system generates tasks for both sales orders.
(0131878)
hgbot   
2021-09-16 17:46   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations/-/merge_requests/32 [^]
(0131902)
hgbot   
2021-09-17 13:09   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations [^]
Changeset: 4eb767e887daf2b68a8c9346d0ca49179938f2f7
Author: Víctor Martínez Romanos <victor.martinez@openbravo.com>
Date: 2021-09-17T11:33:56+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations/-/commit/4eb767e887daf2b68a8c9346d0ca49179938f2f7 [^]

Fixed ISSUE-47551: Implemented lock by object in task generation

The lock only affects the object we are generating tasks for. It avoids to
launch in parallel more than one task generation for this object; for example
two pickings for the same sales order, or a picking and an issue for
the same sales order.

For example, in the case the user tries to launch two picking task generations
for the same sales order in parallel, the first one will actually generate the tasks
meanwhile the second thread is waiting. Then this second thread won't generate
anything because at its execution time the tasks will be already created.

Note that after this lock at document level, there is already implemented another
lock at warehouse level in the moment the tasks are being generated from the task
requirements. So the flow is:
1. A task generation is performed for an object
2. [NEW] the object is locked so no more tasks generation can be launched for it.
3. The tasks requirements are generated
4. Just after the tasks requeriment calculation is over, a Warehouse level lock
is performed, so no tasks generations can be run in parallel for this warehouse.
5. The tasks are created and saved, and all the hooks are executed.
6. The process is completed. In that moment both locks are released.

The warehouse lock was not enough in this case, especially if the task requirement
generation process is slow (for example a sales order with hundred of lines).

From a performance point of view, this lock doesn't add any overhead as it is done
at object level. So it's perfectly fine to generate tasks for two different objects
at the same time.

---
M src/org/openbravo/warehouse/advancedwarehouseoperations/centralbroker/InventoryTransactionTypeAlgorithm.java
---
(0131903)
hgbot   
2021-09-17 13:09   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations/-/merge_requests/32 [^]