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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0039005
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajorrandom2018-07-20 08:132018-08-08 13:06
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PriorityurgentResolutionfixedFixed in Version3.0PR18Q4
StatusclosedFix in branchFixed in SCM revisionabf122047848
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

0039005: BaseComponentProvider is not thread safe

DescriptionBaseComponentProvider has a field (appDependencies) which is thread unsafe.

This static field is a HashMap which is not thread safe, it is generally initialized by different ComponentProviders in their static initializers for example in MobileCoreComponentProvider:

  static {
    // Set dependency on Mobile Core app
    BaseComponentProvider.setAppDependencies(MobileCoreConstants.RETAIL_CORE,
        Arrays.asList(MobileCoreConstants.APP_IDENTIFIER));
  }


If two different threads execute static initializer of different ComponentProviders concurrently, the contents of this field can be uncertain.
Steps To ReproduceUnclear and random.

It could cause the following problem:

1. In an instance with retail
2. Load login page
  -> ERROR: Nothing is loaded an error page is seen saying "The WebPOS cannot be loaded"

This can occur the first time login page is loaded. If it occurs, WebPOS won't be loadable till Tomcat is restarted, if it does not occur 1st load, subsequent ones will continue working.

See https://ci.openbravo.com/view/try-retail/job/try-ret-test-pgsql-suite8/4853/artifact/SANDBOX/automation/pi-mobile/last-results/try-ret-test-pgsql-suite8/screenshots/15%3A01%3A44%20FAILED%3A%20ATT010_AttributesLayaways.png [^]
Proposed SolutionChange appDependencies from HashMap to ConcurrentHashMap.
TagsNo tags attached.
Attached Filespng file icon pos-loading-error.png [^] (34,316 bytes) 2018-07-20 08:15

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 00390063.0PR18Q3 closedalostale BaseComponentProvider is not thread safe 
depends on backport 00390073.0PR18Q2.2 closedalostale BaseComponentProvider is not thread safe 
blocks design defect 0034664 acknowledgedTriage Platform Base multi thread unsafeties 

-  Notes
(0105817)
hgbot (developer)
2018-07-20 08:34

Repository: erp/devel/pi
Changeset: 7c8fe974bb457fabd559cf90b1a234370f3d40a6
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Jul 20 08:28:38 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/7c8fe974bb457fabd559cf90b1a234370f3d40a6 [^]

related to bug 39005: added log

  Added verbose debug log to StaticResourceComponent, to be able to trace issues
  when generating resources.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StaticResourceComponent.java
---
(0105818)
hgbot (developer)
2018-07-20 08:34

Repository: erp/devel/pi
Changeset: abf1220478484730722610844010ccd09671897a
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Jul 20 08:30:59 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/abf1220478484730722610844010ccd09671897a [^]

fixed bug 39005: BaseComponentProvider is not thread safe

  Static appDependencies has been changed from HashMap to ConcurrentHashMap,
  this field can potentially be concurrently initialized from several classes
  being HashMap not thread safe can lead to inconsistent results.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponentProvider.java
---
(0105852)
hgbot (developer)
2018-07-24 10:40

Repository: erp/devel/pi
Changeset: e2c56d84d26d474602c490bef52dc2ffb93cf343
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Tue Jul 24 10:39:37 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e2c56d84d26d474602c490bef52dc2ffb93cf343 [^]

related to issue 39005: minor code improvements

  - Can directly return the createComponentResource result
  - Use diamond operator

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponentProvider.java
---
(0105972)
caristu (developer)
2018-07-27 10:27

Code reviewed
(0106214)
hudsonbot (developer)
2018-08-08 13:06

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/bfd7a414183a [^]
Maturity status: Test
(0106215)
hudsonbot (developer)
2018-08-08 13:06

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/bfd7a414183a [^]
Maturity status: Test
(0106218)
hudsonbot (developer)
2018-08-08 13:06

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/bfd7a414183a [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2018-07-20 08:13 alostale New Issue
2018-07-20 08:13 alostale Assigned To => alostale
2018-07-20 08:13 alostale Modules => Core
2018-07-20 08:13 alostale Triggers an Emergency Pack => No
2018-07-20 08:13 alostale Review Assigned To => caristu
2018-07-20 08:13 alostale Relationship added blocks 0034664
2018-07-20 08:15 alostale File Added: pos-loading-error.png
2018-07-20 08:33 alostale Status new => scheduled
2018-07-20 08:34 hgbot Checkin
2018-07-20 08:34 hgbot Note Added: 0105817
2018-07-20 08:34 hgbot Checkin
2018-07-20 08:34 hgbot Note Added: 0105818
2018-07-20 08:34 hgbot Status scheduled => resolved
2018-07-20 08:34 hgbot Resolution open => fixed
2018-07-20 08:34 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/abf1220478484730722610844010ccd09671897a [^]
2018-07-24 10:40 hgbot Checkin
2018-07-24 10:40 hgbot Note Added: 0105852
2018-07-27 10:27 caristu Note Added: 0105972
2018-07-27 10:27 caristu Status resolved => closed
2018-07-27 10:27 caristu Fixed in Version => 3.0PR18Q4
2018-08-08 13:06 hudsonbot Checkin
2018-08-08 13:06 hudsonbot Note Added: 0106214
2018-08-08 13:06 hudsonbot Checkin
2018-08-08 13:06 hudsonbot Note Added: 0106215
2018-08-08 13:06 hudsonbot Checkin
2018-08-08 13:06 hudsonbot Note Added: 0106218


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker