Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-3890

Removing empty member group from group in JSPUI causes hibernate concurrency error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted / Claimed (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 6.2
    • Fix Version/s: None
    • Component/s: JSPUI
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      0
    • Documentation Status:
      Not Required

      Description

      In JSPUI, since the big service refactor, if a group with no EPerson members (whether or not it has group members) is removed from a parent group, a hibernate concurrency exception is thrown originating from GroupEditServlet, line 194 (6.x) where membergroups is iterated.

      I think it was introduced accidentally when the for loop was rewritten.

      It looks like a similar issue was fixed for EPeople by creating a new arraylist of uuids out of all EPerson objects in the list. I guess this avoids some problem during iteration? (I think maybe some null testing within the loop could help just as well?)

      https://github.com/DSpace/DSpace/commit/bb6d19f410879a3ab60483a76e05052c15779393#diff-df9aa1b5c6dcaac82ecc2f6908a0a7f7

      Reproducing:

      This can be reproduced on demo.dspace.org by logging into JSPUI as admin, creating a group with no members, and adding it to another group (eg a collection admin role group, or just any group), saving, and then trying to remove it. You should see an Internal Server Error.

      Then add any EPerson to the group and attempt the removal of the group from its parent group again. It should now succeed.

      Stack trace:

      2018-04-13 02:52:44,382 WARN  org.dspace.app.webui.servlet.DSpaceServlet @ kim@shepherd.nz:session_id=7D2EC71040421B28203FC3B600E74B2F:ip_addr=10.0.2.2:general_jspui_error:java.util.ConcurrentModificationException
      java.util.ConcurrentModificationException
              at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909)
              at java.util.ArrayList$Itr.next(ArrayList.java:859)
              at org.hibernate.collection.internal.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:810)
              at org.dspace.app.webui.servlet.admin.GroupEditServlet.doDSPost(GroupEditServlet.java:196)
              at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122)
              at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at org.dspace.app.webui.filter.RegisteredOnlyFilter.doFilter(RegisteredOnlyFilter.java:66)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at org.dspace.utils.servlet.DSpaceWebappServletFilter.doFilter(DSpaceWebappServletFilter.java:78)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:221)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
              at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
              at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.lang.Thread.run(Thread.java:748)
      

        Attachments

          Activity

            People

            Assignee:
            kshepherd Kim Shepherd
            Reporter:
            kshepherd Kim Shepherd
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: