You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Andy Schwartz (JIRA)" <de...@myfaces.apache.org> on 2014/06/23 18:35:24 UTC

[jira] [Resolved] (TRINIDAD-2484) Threadsafety issue in SkinStyleProvider leading to missing styles and distorted ui

     [ https://issues.apache.org/jira/browse/TRINIDAD-2484?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Schwartz resolved TRINIDAD-2484.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.1-core
         Assignee: Andy Schwartz

Committed in r1604869.

Thanks for the fix, Prakash!

> Threadsafety issue in SkinStyleProvider leading to missing styles and distorted ui
> ----------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-2484
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2484
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Skinning
>    Affects Versions: 2.1.0-core
>            Reporter: Prakash Udupa
>            Assignee: Andy Schwartz
>             Fix For: 2.1.1-core
>
>         Attachments: TRINIDAD-2484-trunk.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> We have seen that soon after server start, when there are almost concurrent requests from IE, in random occurrences, there will be only one link encoded in the HTML, while there are two css files generated. Consequently, styles for some components in the page could go missing, ending up in distorted UI in certain sections of the rendered page.
> We suspect the cause to be a thread safety issue in SkinStyleProvider implementation where we construct style providers and save it in map keyed by skin and the directory path of the css. The issue is in _getProviders() implementation, where the variable _sSharedProviders is not accessed in threadsafe manner. This leads to possibility of the providers map being overwritten. This further leads to constructing two SkinStyleProviders for the same skin. While one request could use one provider (P1) that is in process of writing out one css file with the second one pending, there could be other request that ends up using a different provider (P2) that would see a single file written, and end up adding single URI in its Entry map. All requests later could end up using P2 and sufferring from only one link being rendered, while there are two stylesheets actually generated.
> Proposed fix is to eliminate "_sSharedProviders", and instead use the application scoped concurrent map hanging off of request scope to store the provider map. We can then leverage on the putIfAbsent in there to ensure there is only one copy of providers map for an application.



--
This message was sent by Atlassian JIRA
(v6.2#6252)