Uploaded image for project: 'Axis'
  1. Axis
  2. AXIS-2878

100% CPU hang when high pressure of concurrent requests

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

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4
    • 1.4.1
    • Basic Architecture
    • None
    • R2+, R3

    Description

      When we are doing the performace testing. we simulate high pressure of concurrent requests to invoke soap service. severals hours later, CPU will be 100% and can not be released when the pressure is stopped.
      We check the stack log and have found several threads are locked at

      java.util.WeakHashMap.getEntry(WeakHashMap.java:375)
      java.util.WeakHashMap.containsKey(WeakHashMap.java:361)
      org.apache.axis.handlers.soap.SOAPService.addSession(SOAPService.java:125)
      org.apache.axis.providers.java.JavaProvider.getSessionServiceObject(JavaProvider.java:185)
      org.apache.axis.providers.java.JavaProvider.getServiceObject(JavaProvider.java:100)
      org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:287)
      org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
      org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
      org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
      org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
      org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
      org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:700)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
      org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

      Because WeakHashMap is not safe within concurrent threads so I doubt maybe there is a problem. I modify the method: addSession of SOAPService.java (org.apache.axis.handlers.soap)
      add the 'synchronized ':
      synchronized (map)
      {
      if (!(map.containsKey(session)))

      { map.put(session, null); }

      }

      Then the cpu problem does not occur.

      Attachments

        Issue Links

        Activity

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

          People

            veithen Andreas Veithen
            sdcsdc77 songdacheng
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment