Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0025310Openbravo ERPA. Platformpublic2013-12-11 16:522014-03-24 12:09
egoitz 
alostale 
normalmajorrandom
closedfixed 
5
 
3.0PR14Q23.0PR14Q2 
shankarb
Core
No
0025310: Java processes locked on tomcat
When login to the server from a pos terminal, on some cases there are some locks that causes processes being using 100% of a cpu.
They never finish and it is needed to restart tomcat.
-Login with different users to pos terminal
*Attached yo can find a stack trace with some lock processes.

Editing the file
src/org/openbravo/dal/security/EntityAccessChecker.java
by replacing
public void initialize() {
with
public synchronized void initialize() {
solves the problem but this is a workarround and not a final solution.
No tags attached.
related to defect 00244213.0MP28 closed alostale ApplicationDictionaryCachedStructures is not thread safe 
txt jstack-2013-10-08_13.07.07.txt (50,680) 2013-12-11 16:52
https://issues.openbravo.com/file_download.php?file_id=6565&type=bug
Issue History
2013-12-11 16:52egoitzNew Issue
2013-12-11 16:52egoitzAssigned To => AugustoMauch
2013-12-11 16:52egoitzFile Added: jstack-2013-10-08_13.07.07.txt
2013-12-11 16:52egoitzModules => Core
2013-12-11 16:52egoitzResolution time => 1358204400
2013-12-11 16:52egoitzTriggers an Emergency Pack => No
2014-01-24 08:45alostaleAssigned ToAugustoMauch => alostale
2014-03-12 10:42jonalegriaesarteResolution time1358204400 => 1363302000
2014-03-21 10:48alostaleRelationship addedrelated to 0024421
2014-03-21 10:52alostaleNote Added: 0065349
2014-03-21 10:52alostaleReview Assigned To => shankarb
2014-03-21 10:57hgbotCheckin
2014-03-21 10:57hgbotNote Added: 0065350
2014-03-21 10:57hgbotStatusnew => resolved
2014-03-21 10:57hgbotResolutionopen => fixed
2014-03-21 10:57hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/530197ef5760542451747fd554e0cd613c3837f5 [^]
2014-03-22 04:14hudsonbotCheckin
2014-03-22 04:14hudsonbotNote Added: 0065374
2014-03-24 12:09shankarbNote Added: 0065389
2014-03-24 12:09shankarbStatusresolved => closed
2014-03-24 12:09shankarbFixed in Version => PR14Q2

Notes
(0065349)
alostale   
2014-03-21 10:52   
The problem seen in the attached stack trace occurs if more than one thread with the same session are concurrently executed, the 2nd one is launched while the 1st one is initializing access checker, it is detected as not initialized and starts parallel initialization. In this situation, it is possible both threads to be concurrently modifying not syncrhonized Maps causing this problem.

Proposed solution is going to be applied. Making init method synchronized should not cause performance degradation problems as it should executed just once per context session so not much concurrency should happen at this point.
(0065350)
hgbot   
2014-03-21 10:57   
Repository: erp/devel/pi
Changeset: 530197ef5760542451747fd554e0cd613c3837f5
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Mar 21 10:56:40 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/530197ef5760542451747fd554e0cd613c3837f5 [^]

fixed bug 25310: EntityAccessChecker can be locked by concurrent rquests

 Making initialize method synchronized prevents this problem, this is the only
 method modifying internal variables which are not synchronized.

---
M src/org/openbravo/dal/security/EntityAccessChecker.java
---
(0065374)
hudsonbot   
2014-03-22 04:14   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/b70224bef848 [^]
Maturity status: Test
(0065389)
shankarb   
2014-03-24 12:09   
Code reviewed and verified in pi changeset b24d8a94df0e.