Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-650

Calling Servlet forward after Servlet/ JSP include call will result in StackOverflowError in Wilfly internal and cause infinispan distributed session deadlock forever

XMLWordPrintable

    • Hide
      Show
      Deploy request-include-forward-stackoverflow.war with Wildfly HA profile Open http://localhost:8080/request-include-forward-stackoverflow/ Click the link "Servlet include then Servlet forward" or "JSP include then Servlet forward" Server will throw StackOverflowError Try to refresh http://localhost:8080/request-include-forward-stackoverflow/ again, will not success due to infinitspan distributed session lock forever.

      We just experienced an issue about infinispan distributed session hang forever in our cluster enabled environment. After investigation, we finally found it is due to a StackOverflowError throw in the Wildfly internal, after doing the following thing:
      foo.jsp:

          <!-- some other HTML tag here, which is not related, just need to ensure something already write to the output -->
          <jsp:include page="/include.jsp" />
      

      include.jsp:

      <%  
          // read and write some session attributes here, to lock the infinispan distributed session forever...
          session.setAttribute("someAttribute", "someValue");
          // then do a Servlet forward, will result in a StackOverflowError, and the infinispan cache lock will not be release, so the whole server hang...
          // while the "forward.jsp" is not related, can even be a blank JSP.
          request.getRequestDispatcher("/forward.jsp").forward(request, response);
          return;
      %>
      

      This issue already tested in Wildfly 8.2.1.Final, 9.0.2.Final and 10.0.0.Final with the shipped standalone-full-ha.xml configuration, both of them can be reproduced.

      The reproducible sample is enclosed.

            sdouglas1@redhat.com Stuart Douglas
            sammyhk Sammy Chu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: