Bug 49987 - Data race in ApplicationContext
Data race in ApplicationContext
Product: Tomcat 6
Classification: Unclassified
Component: Catalina
PC All
: P3 minor (vote)
: default
Assigned To: Tomcat Developers Mailing List
Depends on:
  Show dependency tree
Reported: 2010-09-23 10:16 UTC by Sergey Vorobyev
Modified: 2010-10-13 10:42 UTC (History)
2 users (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Vorobyev 2010-09-23 10:16:06 UTC

Data race on variable 
private Map parameters

In method

    private void mergeParameters() {

        if (parameters != null)  // concurrent read : 881
        Map results = new ConcurrentHashMap();
        parameters = results; // concurrent write : 897

Comment 1 Tim Whittington 2010-09-30 03:45:45 UTC
The best way to fix this is probably to do the merge in the startup lifecycle (probably near the end of StandardContext.startInternal) and set the parameters into the ApplicationContext.
(ApplicationContext is constructed and used before local application parameters are added in the lifecycle)
Comment 2 Mark Thomas 2010-10-07 17:56:06 UTC
Fixed in trunk and will be included in 7.0.4 onwards.

Proposed for 6.0.x
Comment 3 Mark Thomas 2010-10-13 10:42:37 UTC
Fixed in 6.0.x and will be included in 6.0.30 onwards.