Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0037015
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformminorhave not tried2017-10-05 16:582017-11-29 10:34
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in Version3.0PR18Q1
StatusclosedFix in branchFixed in SCM revision34f3cf610264
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0037015: contention in DAL proxies with high concurrency

DescriptionWhenever a Hibernate proxied object is accessed to any of its methods, even if it is already hydrated, a lock is created at entity's method level, so it is only possible to access this method once a time even in different instances.

For example:

  Thread 1
     Module modInstance1 = OBDal.getInstance().get(Module.class, "0");
     Client clientProxyInstance1 = modInstance1.getClient();           // we have a proxy
     clientProxyInstance1.getId();                                     // accessing to a method in the 
proxy

  Thread 2
     Module modInstance2 = OBDal.getInstance().get(Module.class, "0"); // another Module instance
     
Client clientProxyInstance2 = modInstance1.getClient();           // another proxy instance
     clientProxyInstance2.getId();                                     // accessing to a method in the 
proxy     


In this example, clientProxyInstance1.getId() and clientProxyInstance2.getId() cannot be executed concurrently because both of them try to get a lock on Client.getId method.
Steps To Reproduce-Execute attached test profiling locks and monitors
  -> See attached image where it can be seen threads waiting for RuntimeSupport.find2Methods
Proposed SolutionThis is an issue [1] in the javassist version that currently Openbravo depends on (3.14.0-GA), which is fixed since 3.17.0-GA.

Decide to which version update, maybe to 3.20.0-GA, which is not the latest one but the one currently Hibernate depends on [2].

Note 3.17 seems to be buggy an Hibernate moved from it [3][4].

Testing with 3.20.0-GA solves the contention issue (see attached image) which is the same test execution without any thread waiting.

---
[1] https://issues.jboss.org/browse/JASSIST-163 [^]
[2] https://github.com/hibernate/hibernate-orm/blob/00492a3707b9128b34646166f6eff402a8169011/libraries.gradle#L20 [^]
[3] https://hibernate.atlassian.net/browse/HHH-7923 [^]
[4] https://issues.jboss.org/browse/JASSIST-189 [^]
TagsPerformance
Attached Filespng file icon Selection_214.png [^] (78,055 bytes) 2017-10-05 17:04


? file icon DalProxyConcurrency.java [^] (2,013 bytes) 2017-10-05 17:11
png file icon Same-Test-New-Jar.png [^] (17,673 bytes) 2017-10-05 17:20

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0020515 closedalostale OBCriteria creates contention at JVM 
related to feature request 0037064 closedcaristu upgrade hibernate 

-  Notes
(0100644)
hgbot (developer)
2017-11-21 10:26

Repository: erp/devel/pi
Changeset: 34f3cf610264a9eb4342f421f67d179d4cbdfa7d
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Nov 13 13:52:55 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/34f3cf610264a9eb4342f421f67d179d4cbdfa7d [^]

fixed 37015: contention in DAL proxies with high concurrency

  Updated javassisit library from 3.14.0-GA to 3.20.0-GA to solve
  JASSIST-163: RuntimeSupport.find2Methods perf hotspot when proxy's methods are called at higher concurrency [1].

   [1] https://issues.jboss.org/browse/JASSIST-163 [^]

---
M legal/Licensing.txt
A lib/runtime/javassist-3.20.0-GA.jar
R lib/runtime/javassist-3.14.0-GA.jar
---
(0100804)
caristu (developer)
2017-11-29 10:34

Reviewed

Updated wiki page: http://wiki.openbravo.com/wiki/Openbravo_Libraries [^]

- Issue History
Date Modified Username Field Change
2017-10-05 16:58 alostale New Issue
2017-10-05 16:58 alostale Assigned To => platform
2017-10-05 16:58 alostale Modules => Core
2017-10-05 16:58 alostale Triggers an Emergency Pack => No
2017-10-05 17:04 alostale Steps to Reproduce Updated View Revisions
2017-10-05 17:04 alostale File Added: Selection_214.png
2017-10-05 17:10 alostale Proposed Solution updated
2017-10-05 17:11 alostale File Added: DalProxyConcurrency.java
2017-10-05 17:17 alostale Proposed Solution updated
2017-10-05 17:18 alostale Proposed Solution updated
2017-10-05 17:19 shuehner Issue Monitored: shuehner
2017-10-05 17:20 alostale File Added: Same-Test-New-Jar.png
2017-10-05 17:21 alostale Proposed Solution updated
2017-10-05 17:26 alostale Tag Attached: Performance
2017-10-06 10:42 alostale Relationship added related to 0020515
2017-10-06 11:16 alostale Status new => acknowledged
2017-10-13 12:40 alostale Relationship added related to 0037064
2017-11-21 10:26 hgbot Checkin
2017-11-21 10:26 hgbot Note Added: 0100644
2017-11-21 10:26 hgbot Status acknowledged => resolved
2017-11-21 10:26 hgbot Resolution open => fixed
2017-11-21 10:26 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/34f3cf610264a9eb4342f421f67d179d4cbdfa7d [^]
2017-11-21 10:26 alostale Assigned To platform => alostale
2017-11-21 10:27 alostale Review Assigned To => caristu
2017-11-29 10:34 caristu Note Added: 0100804
2017-11-29 10:34 caristu Status resolved => closed
2017-11-29 10:34 caristu Fixed in Version => 3.0PR18Q1


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker