Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-50886

Race condition during parallel rendering in IconMenuTag

    Details

    • Type: Regression Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 6.2.X EE, 7.0.0 M3
    • Fix Version/s: 7.0.1 CE GA2
    • Component/s: Core Infrastructure
    • Labels:
      None

      Description

      Steps to reproduce

      1) Add a new page p1
      2) Add several Web Content Display portlets to p1
      3) Refresh p1 in the browser couple of times

      Sometimes the following error message appears in the log.

      13:55:56,296 ERROR [RuntimePageImpl-8][IncludeTag:129] Current URL /web/guest/p1 generates exception: null
      java.util.ConcurrentModificationException
      	at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)
      	at java.util.ArrayList$Itr.next(ArrayList.java:831)
      	at com.liferay.portal.kernel.servlet.taglib.aui.ScriptData.reset(ScriptData.java:73)
      	at com.liferay.taglib.ui.IconMenuTag.doAfterBody(IconMenuTag.java:66)
      	at org.apache.jsp.html.portlet.journal_005fcontent.view_jsp._jspService(view_jsp.java:2363)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      	at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
      	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:75)
      	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:52)
      	at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:312)
      	at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:193)
      	at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:84)
      	at org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:3857)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
      	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      

      Notes for QA

      The issue stems from the fact that java.util.ArrayList isn't thread-safe, but these kind of issues cannot be reproduced consistently.

      Alternate reproduction steps:

      1. modify in liferay-portlet.xml the render-weight of portlet 148 to 40
      2. modify ROOT/html/taglib/portlet/icon-options/page.jsp and remove following
        	<liferay-portlet:icon-maximize />
        
        	<liferay-portlet:icon-minimize />
      3. start portal
      4. create a site role Site with Site pages > Page : Update permission
      5. Create User and add him as member of Liferay site and ssign him the created role
      6. Add a Blogs and several Tags Cloud portlets (the more the better ) to Welcome page
      7. Visit the Welcome page with the user
      8. Put something on F5 and wait

      Once in a while you will get exceptions like:

      08:17:26,449 ERROR [RuntimePageImpl-12][IncludeTag:129] Current URL /web/guest/home generates exception: null
      java.lang.NullPointerException
              at com.liferay.portal.kernel.servlet.taglib.aui.ScriptData.reset(ScriptData.java:74)
              at com.liferay.taglib.ui.IconMenuTag.doAfterBody(IconMenuTag.java:66)
              at org.apache.jsp.html.taglib.portlet.icon_005foptions.page_jsp._jspService(page_jsp.java:893)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
              at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:290)
              at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:184)
              at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:75)
              at com.liferay.taglib.util.IncludeTag.runTag(IncludeTag.java:126)
              at com.liferay.taglib.util.VelocityTaglibImpl.portletIconOptions(VelocityTaglibImpl.java:891)
              at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
              at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
              at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
              at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
              at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342)
              at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
              at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
      08:17:26,449 ERROR [RuntimePageImpl-7][IncludeTag:129] Current URL /web/guest/home generates exception: null
      java.lang.NullPointerException
              at com.liferay.portal.kernel.servlet.taglib.aui.ScriptData.reset(ScriptData.java:74)
              at com.liferay.taglib.ui.IconMenuTag.doAfterBody(IconMenuTag.java:66)
              at org.apache.jsp.html.taglib.portlet.icon_005foptions.page_jsp._jspService(page_jsp.java:893)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
              at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:290)
              at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:184)
              at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:75)
              at com.liferay.taglib.util.IncludeTag.runTag(IncludeTag.java:126)
              at com.liferay.taglib.util.VelocityTaglibImpl.portletIconOptions(VelocityTaglibImpl.java:891)
              at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
              at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
              at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
              at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
              at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342)
              at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
              at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
      

      Root cause:
      When you have portlets with different render waits they are rendered in batches based on render weight and if a portlet in a batch put a ScriptData in the response then the following batches portlets might try to use it in a concurrent manne, but that class is not thread safe.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 26 weeks, 3 days ago

                  Packages

                  Version Package
                  7.0.1 CE GA2