You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Joe Bergmark (JIRA)" <ji...@apache.org> on 2010/04/27 20:28:32 UTC

[jira] Created: (OWB-363) Intermittent bug with ApplicationScope disposers not being called

Intermittent bug with ApplicationScope disposers not being called
-----------------------------------------------------------------

                 Key: OWB-363
                 URL: https://issues.apache.org/jira/browse/OWB-363
             Project: OpenWebBeans
          Issue Type: Bug
          Components: Context and Scopes
    Affects Versions: M4
            Reporter: Joe Bergmark
            Assignee: Gurkan Erdogdu
            Priority: Minor


While testing an application have seen an issue where disposers for application scoped producer methods are not called.  Took a quick peek at the WebContextService, and I suspect the ThreadLocal may not be correct for the thread that is handling the application stop.

It seems to me that we already have a 1:1 mapping of WebContextService (loaded based on the classloader by WebBeansFinder) to the application, so we could probably make the ApplicationContext field non-static and non-threadlocal.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OWB-363) Intermittent bug with ApplicationScope disposers not being called

Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gurkan Erdogdu updated OWB-363:
-------------------------------

    Fix Version/s: 1.0.0

> Intermittent bug with ApplicationScope disposers not being called
> -----------------------------------------------------------------
>
>                 Key: OWB-363
>                 URL: https://issues.apache.org/jira/browse/OWB-363
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Joe Bergmark
>            Assignee: Gurkan Erdogdu
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> While testing an application have seen an issue where disposers for application scoped producer methods are not called.  Took a quick peek at the WebContextService, and I suspect the ThreadLocal may not be correct for the thread that is handling the application stop.
> It seems to me that we already have a 1:1 mapping of WebContextService (loaded based on the classloader by WebBeansFinder) to the application, so we could probably make the ApplicationContext field non-static and non-threadlocal.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OWB-363) Intermittent bug with ApplicationScope disposers not being called

Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12861887#action_12861887 ] 

Gurkan Erdogdu commented on OWB-363:
------------------------------------

YING, you are right! I updated code to look saved ApplicationContext currentApplicationContexts before looking ThreadLocal. Also I reset thread local application context while destroying request.

> Intermittent bug with ApplicationScope disposers not being called
> -----------------------------------------------------------------
>
>                 Key: OWB-363
>                 URL: https://issues.apache.org/jira/browse/OWB-363
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Joe Bergmark
>            Assignee: Gurkan Erdogdu
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> While testing an application have seen an issue where disposers for application scoped producer methods are not called.  Took a quick peek at the WebContextService, and I suspect the ThreadLocal may not be correct for the thread that is handling the application stop.
> It seems to me that we already have a 1:1 mapping of WebContextService (loaded based on the classloader by WebBeansFinder) to the application, so we could probably make the ApplicationContext field non-static and non-threadlocal.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OWB-363) Intermittent bug with ApplicationScope disposers not being called

Posted by "YING WANG (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12861834#action_12861834 ] 

YING WANG commented on OWB-363:
-------------------------------

Gurkan, Joe, I took a look on the latest change. It could fix the applicationContext is not destroyed issue when shutting down. However, I feel it is still possible that wrong applicationContext gets destroyed in multiple applications env. such as:

T1:  Thread 1 handles App1 and have threadLocal applicationContext(app1)
T2:  Thread 2 handles App2 and have threadLocal applicationContext(app2)
T3:  app2 shutdown by admin and thread 1 handles it, since it has applicationContext(app1), according to current logic in destroyApplicationContext, app1's applicationContext get destroyed.  (I didn't find applicationContext get reset after each request.)

How about directly extract applicationContext from currentApplicationContexts(serveletContext) and do not use threadLocal one in destroyApplicationcontext () or make applicationContext a non-threadLocal, non-static variable like Joe said? 



> Intermittent bug with ApplicationScope disposers not being called
> -----------------------------------------------------------------
>
>                 Key: OWB-363
>                 URL: https://issues.apache.org/jira/browse/OWB-363
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Joe Bergmark
>            Assignee: Gurkan Erdogdu
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> While testing an application have seen an issue where disposers for application scoped producer methods are not called.  Took a quick peek at the WebContextService, and I suspect the ThreadLocal may not be correct for the thread that is handling the application stop.
> It seems to me that we already have a 1:1 mapping of WebContextService (loaded based on the classloader by WebBeansFinder) to the application, so we could probably make the ApplicationContext field non-static and non-threadlocal.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OWB-363) Intermittent bug with ApplicationScope disposers not being called

Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gurkan Erdogdu closed OWB-363.
------------------------------

    Resolution: Fixed

> Intermittent bug with ApplicationScope disposers not being called
> -----------------------------------------------------------------
>
>                 Key: OWB-363
>                 URL: https://issues.apache.org/jira/browse/OWB-363
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Joe Bergmark
>            Assignee: Gurkan Erdogdu
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> While testing an application have seen an issue where disposers for application scoped producer methods are not called.  Took a quick peek at the WebContextService, and I suspect the ThreadLocal may not be correct for the thread that is handling the application stop.
> It seems to me that we already have a 1:1 mapping of WebContextService (loaded based on the classloader by WebBeansFinder) to the application, so we could probably make the ApplicationContext field non-static and non-threadlocal.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.