Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-412

Race condition in RequestInterceptor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.1 Final
    • 2.01
    • None
    • None
    • any

    Description

      [taken from magnolia-dev, reporter: ]

      <<<<

      I think I've found a race condition in
      info.magnolia.cms.servlets.RequestInterceptor:

      --------------------------
      public void doGet(HttpServletRequest request, HttpServletResponse
      response)

      { this.request = request; this.response = response; this.action(); }

      ....
      private void action() {
      String action=this.getRequest().getParameter(EntryServlet.INTERCEPT);

      String repository=this.getRequest().getParameter("mgnlRepository");
      ....
      --------------------------

      IIRC, servlets are multithreaded. That is, for the webapp there will be
      only one instantiated RequestInterceptor object. It's bad practice to use
      member variables in servlets, because concurrent requests will overwrite
      each others' data and cause all kinds of havoc.

      Why aren't the request and response simply passed to the action method as
      parameters? Or, why is there even an action method at all, since the only
      thing doGet does is call the action method?

      This same type of race condition is also present in the SimpleExchange
      class (same package).

      Thanks for your time,

      • jonathan.

      >>>>

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              kraft Boris Kraft
              weder Andreas Weder
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD