You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Bartek Wasko (JIRA)" <ji...@apache.org> on 2008/07/28 11:18:05 UTC

[jira] Created: (STR-3161) Servlet not injected into newly created action in higly concurrent env

Servlet not injected into newly created action in higly concurrent env
----------------------------------------------------------------------

                 Key: STR-3161
                 URL: https://issues.apache.org/struts/browse/STR-3161
             Project: Struts 1
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.3.8
         Environment: win xp, jvm 1.5.0_12
            Reporter: Bartek Wasko


In struts 1.3.8 we encountered such an issue

 getServlet() invoked from action code returns null.

After quick investigation I found a bit susspicious place in the
RequestProcessor#processActionCreate code.
The synchronized block seems to be a bit risky in highly concurrent  environment because it does not cover also  the code injecting servlet into freshly created action:

if (instance.getServlet() == null) {
instance.setServlet(this.servlet);
}

After I had extended  synchronisation to above code fragment, it seems,  our nullpointer vanished.

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


[jira] Commented: (STR-3161) Servlet not injected into newly created action in higly concurrent env

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/STR-3161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44487#action_44487 ] 

Niall Pemberton commented on STR-3161:
--------------------------------------

Also ported to 1.3 Branch: http://svn.apache.org/viewvc?view=rev&revision=680350

> Servlet not injected into newly created action in higly concurrent env
> ----------------------------------------------------------------------
>
>                 Key: STR-3161
>                 URL: https://issues.apache.org/struts/browse/STR-3161
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.3.8
>         Environment: win xp, jvm 1.5.0_12
>            Reporter: Bartek Wasko
>            Assignee: Niall Pemberton
>             Fix For: 1.3.10
>
>         Attachments: RequestProcessor.patch
>
>
> In struts 1.3.8 we encountered such an issue
>  getServlet() invoked from action code returns null.
> After quick investigation I found a bit susspicious place in the
> RequestProcessor#processActionCreate code.
> The synchronized block seems to be a bit risky in highly concurrent  environment because it does not cover also  the code injecting servlet into freshly created action:
> if (instance.getServlet() == null) {
> instance.setServlet(this.servlet);
> }
> After I had extended  synchronisation to above code fragment, it seems,  our nullpointer vanished.

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


[jira] Resolved: (STR-3161) Servlet not injected into newly created action in higly concurrent env

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/STR-3161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton resolved STR-3161.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.10
         Assignee: Niall Pemberton

Thanks, I have applied your patch:
    http://svn.apache.org/viewvc?view=rev&revision=680345

However I'm wondering why you're still using the RequestProcessor with Struts 1.3.x? The new ComposableRequestProcessor delegates this to the CreateAction command and the whole method is synchronized (so should resolve this issue for you):

http://svn.apache.org/repos/asf/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java

> Servlet not injected into newly created action in higly concurrent env
> ----------------------------------------------------------------------
>
>                 Key: STR-3161
>                 URL: https://issues.apache.org/struts/browse/STR-3161
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.3.8
>         Environment: win xp, jvm 1.5.0_12
>            Reporter: Bartek Wasko
>            Assignee: Niall Pemberton
>             Fix For: 1.3.10
>
>         Attachments: RequestProcessor.patch
>
>
> In struts 1.3.8 we encountered such an issue
>  getServlet() invoked from action code returns null.
> After quick investigation I found a bit susspicious place in the
> RequestProcessor#processActionCreate code.
> The synchronized block seems to be a bit risky in highly concurrent  environment because it does not cover also  the code injecting servlet into freshly created action:
> if (instance.getServlet() == null) {
> instance.setServlet(this.servlet);
> }
> After I had extended  synchronisation to above code fragment, it seems,  our nullpointer vanished.

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


[jira] Updated: (STR-3161) Servlet not injected into newly created action in higly concurrent env

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/STR-3161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Benedict updated STR-3161:
-------------------------------

    Fix Version/s: 1.4.0

> Servlet not injected into newly created action in higly concurrent env
> ----------------------------------------------------------------------
>
>                 Key: STR-3161
>                 URL: https://issues.apache.org/struts/browse/STR-3161
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.3.8
>         Environment: win xp, jvm 1.5.0_12
>            Reporter: Bartek Wasko
>            Assignee: Niall Pemberton
>             Fix For: 1.3.10, 1.4.0
>
>         Attachments: RequestProcessor.patch
>
>
> In struts 1.3.8 we encountered such an issue
>  getServlet() invoked from action code returns null.
> After quick investigation I found a bit susspicious place in the
> RequestProcessor#processActionCreate code.
> The synchronized block seems to be a bit risky in highly concurrent  environment because it does not cover also  the code injecting servlet into freshly created action:
> if (instance.getServlet() == null) {
> instance.setServlet(this.servlet);
> }
> After I had extended  synchronisation to above code fragment, it seems,  our nullpointer vanished.

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


[jira] Updated: (STR-3161) Servlet not injected into newly created action in higly concurrent env

Posted by "Bartek Wasko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/STR-3161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bartek Wasko updated STR-3161:
------------------------------

    Attachment: RequestProcessor.patch

Patch - synchronisation extended (RequestProcessor.processActionCreate) to cover also code, where servlet is injected into action.

> Servlet not injected into newly created action in higly concurrent env
> ----------------------------------------------------------------------
>
>                 Key: STR-3161
>                 URL: https://issues.apache.org/struts/browse/STR-3161
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.3.8
>         Environment: win xp, jvm 1.5.0_12
>            Reporter: Bartek Wasko
>         Attachments: RequestProcessor.patch
>
>
> In struts 1.3.8 we encountered such an issue
>  getServlet() invoked from action code returns null.
> After quick investigation I found a bit susspicious place in the
> RequestProcessor#processActionCreate code.
> The synchronized block seems to be a bit risky in highly concurrent  environment because it does not cover also  the code injecting servlet into freshly created action:
> if (instance.getServlet() == null) {
> instance.setServlet(this.servlet);
> }
> After I had extended  synchronisation to above code fragment, it seems,  our nullpointer vanished.

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