Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-1034

infinite loop 100% CPU at org.jboss.errai.bus.server.HttpSessionProvider$HttpSessionWrapper.getAttribute(HttpSessionProvider.java:147)

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.1.Final
    • Fix Version/s: None
    • Component/s: ErraiBus
    • Labels:
      None
    • Workaround Description:
      Hide

      use ConcurrentHashMap instead of HashMap

      Show
      use ConcurrentHashMap instead of HashMap

      Description

      HttpSessionProvider uses a SessionsContainer which uses a HashMap for sharedAttributes and queueSessions.
      Under concurrent use the org.jboss.errai.bus.server.HttpSessionProvider$HttpSessionWrapper.getAttribute(HttpSessionProvider.java:147) method will get into an infinite loop inside java.util.HashMap.getEntry(HashMap.java:465) thus leading to 100% cpu usage.

      stacktrace of the looping thread:

      "pool-32-thread-1" prio=10 tid=0x00007fd1541e4000 nid=0x368d runnable [0x00007fd245df7000]
      java.lang.Thread.State: RUNNABLE
      at java.util.HashMap.getEntry(HashMap.java:469)
      at java.util.HashMap.get(HashMap.java:421)
      at org.jboss.errai.bus.server.HttpSessionProvider$HttpSessionWrapper.getAttribute(HttpSessionProvider.java:147)
      at org.jboss.errai.bus.server.util.LocalContext.getLocalContext(LocalContext.java:123)

      • locked <0x000000047e5bbb38> (a org.jboss.errai.bus.server.util.LocalContext)
        at org.jboss.errai.bus.server.util.LocalContext.<init>(LocalContext.java:46)
        at org.jboss.errai.bus.server.util.LocalContext.get(LocalContext.java:33)
        at org.jboss.errai.bus.server.util.ServerLaundryList.get(ServerLaundryList.java:34)
        at org.jboss.errai.bus.server.service.bootstrap.DefaultResources$2.getLaundryList(DefaultResources.java:62)
        at org.jboss.errai.bus.server.HttpSessionProvider$HttpSessionWrapper.fireSessionEndListeners(HttpSessionProvider.java:176)
        at org.jboss.errai.bus.server.HttpSessionProvider$HttpSessionWrapper.endSession(HttpSessionProvider.java:131)
        at org.jboss.errai.bus.server.ServerMessageBusImpl$HousekeeeperRunnable.doCleanup(ServerMessageBusImpl.java:1311)
        at org.jboss.errai.bus.server.ServerMessageBusImpl$HousekeeeperRunnable.run(ServerMessageBusImpl.java:1266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mbarkley Max Barkley
                Reporter:
                ggaborg Gabor Andras
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: