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

infinite loop 100% CPU in generated ServerMarshallingFactoryImpl.getMarshaller

    Details

    • Steps to Reproduce:
      Hide

      Happened only twice in 2 years under heavy load and multi threading.

      Show
      Happened only twice in 2 years under heavy load and multi threading.
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Modified the code which generates the ServerMarshallingFactoryImpl to use a ConcurrentHashMap instead of the HashMap

      MarshallerGeneratorFactory line 208:
      Class<? extends Map> mapClass = target == MarshallerOutputTarget.GWT ? HashMap.class : ConcurrentHashMap.class;
      autoInitializedField(classStructureBuilder, javaUtilMap, MARSHALLERS_VAR, mapClass);

      Show
      Modified the code which generates the ServerMarshallingFactoryImpl to use a ConcurrentHashMap instead of the HashMap MarshallerGeneratorFactory line 208: Class<? extends Map> mapClass = target == MarshallerOutputTarget.GWT ? HashMap.class : ConcurrentHashMap.class; autoInitializedField(classStructureBuilder, javaUtilMap, MARSHALLERS_VAR, mapClass);

      Description

      Generated ServerMarshallingFactoryImpl uses a HashMap for the Marshallers.
      Under concurrent use the getMarshaller method will get into an infinite loop inside java.util.HashMap.getEntry(HashMap.java:465) thus leading to 100% cpu usage.
      It happens for all threads delivering messages.

      https://www.google.ro/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=hashmap+getEntry+infinite+loop

        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:
                  Resolved: