Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-3161

Servlet not injected into newly created action in higly concurrent env

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3.8
    • 1.3.10, 1.4.0
    • Core
    • None
    • win xp, jvm 1.5.0_12

    Description

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            niallp Niall Pemberton
            bartek Bartek Wasko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment