Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0049524Openbravo ERP02. Master data managementpublic2022-06-09 16:302022-06-21 15:54
gorkaion 
igor_trebol 
highmajoralways
closedfixed 
5
 
PR22Q3 
Core
No
0049524: ProductCharacteristicValueEventHandler creates and hold a lock on 100 products
The ProductCharacteristicValueEventHandler creates an import entry to run the VariantChDescUpdate process that can hold up to 100 products.

When this happens a lock is created on the products that is not released until the VariantChDescUpdate process finishes for all of them.

This can create contention on other processes running in parallel modifying the same set of products.

This is reproduced on a customer instance running integrations on Characteristics and Products at the same time. Initially a dead-lock was generated. We have fix the product integration to release the lock on the product earlier but now we are having contention cuased by the ProductCharacteristicValueEventHandler/VariantChDescUpdate process.
It is required:
1. A characteristic defined on 100 products.
2. Modify the value of a characteristic so it is required to update the ch description of those products.
3. Check that the VariantChDescUpdate is run and a lock is created for all the products and not released until the process finishes.
solution 1: Modify VariantChDescUpdateProcessor [1] so a commit is executed on each product update to release the lock.

solution 2: Modify ProductCharacteristicValueEventHandler [2]to reduce the Import Entry Size constant to a lower value (1?) or make it configurable.



[1] https://gitlab.com/openbravo/product/openbravo/-/blob/master/src/org/openbravo/materialmgmt/VariantChDescUpdateProcessor.java#L64 [^]
[2] https://gitlab.com/openbravo/product/openbravo/-/blob/master/src/org/openbravo/event/ProductCharacteristicValueEventHandler.java#L48 [^]
NOR
related to defect 0037852 closed markmm82 VariantChDescUpdateProcessor fails with OutOfMemoryError when there are many products to update 0000752:0000600 
related to design defect 0033210pi closed gorkaion VariantChDescUpdateProcess executed using ImportEntries instead of ProcessBundle 
Issue History
2022-06-09 16:30gorkaionNew Issue
2022-06-09 16:30gorkaionAssigned To => Triage Omni OMS
2022-06-09 16:30gorkaionModules => Core
2022-06-09 16:30gorkaionTriggers an Emergency Pack => No
2022-06-14 12:31rafarodaTag Attached: NOR
2022-06-15 16:40aferrazRelationship addedrelated to 0037852
2022-06-15 16:41aferrazAssigned ToTriage Omni OMS => igor_trebol
2022-06-16 13:50igor_trebolRelationship addedrelated to 0033210
2022-06-20 16:07hgbotNote Added: 0138570
2022-06-21 15:54hgbotResolutionopen => fixed
2022-06-21 15:54hgbotStatusnew => closed
2022-06-21 15:54hgbotFixed in Version => PR22Q3
2022-06-21 15:54hgbotNote Added: 0138596
2022-06-21 15:54hgbotNote Added: 0138597

Notes
(0138570)
hgbot   
2022-06-20 16:07   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/624 [^]
(0138596)
hgbot   
2022-06-21 15:54   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 6f437d75521e21efd2965cb11b57ab2aa992d560
Author: Igor Trebol <igor.trebol@openbravo.com>
Date: 21-06-2022 15:53:09
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/6f437d75521e21efd2965cb11b57ab2aa992d560 [^]

Fixes ISSUE-49524: Each product is commited after changing the description on characteristic update

---
M src/org/openbravo/materialmgmt/VariantChDescUpdateProcessor.java
---
(0138597)
hgbot   
2022-06-21 15:54   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/624 [^]