Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-9491

JBoss 6.0.0-Final leaks an AsyncInvocationIdUUIDImpl object for every asynchronous call

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • Open To Community
    • 6.0.0.Final
    • EJB
    • None
    • Hide

      Basically, AsyncInvocationIdUUIDImpl fails the following JUnit test:

      @Test
      public void testWithConcurrentHashMap() {
          AsyncInvocationId uuid = new AsyncInvocationIdUUIDImpl();
          Map<AsyncInvocationId, Boolean> map = new ConcurrentHashMap<AsyncInvocationId, Boolean>();
      
          map.put(uuid, Boolean.TRUE);
          map.remove(uuid);
      
          assertTrue(map.isEmpty());
      }
      

      This same test also fails with Hashtable, although it passes with HashMap and LinkedHashMap.

      Show
      Basically, AsyncInvocationIdUUIDImpl fails the following JUnit test: @Test public void testWithConcurrentHashMap() { AsyncInvocationId uuid = new AsyncInvocationIdUUIDImpl(); Map<AsyncInvocationId, Boolean > map = new ConcurrentHashMap<AsyncInvocationId, Boolean >(); map.put(uuid, Boolean .TRUE); map.remove(uuid); assertTrue(map.isEmpty()); } This same test also fails with Hashtable , although it passes with HashMap and LinkedHashMap .

    Description

      The AsyncInvocationIdUUIDImpl.equals() method is implemented as:

      @Override
      public boolean equals(final Object obj) {
          return uuid.equals(obj);
      }
      

      This implementation is incompatible with ConcurrentHashMap<AsyncInvocationId, Boolean>, which means that AsyncInvocationMap.remove(id) does not remove the AsyncInvocationIdUUIDImpl object from the map at all. In other words, the AsynchronousServerInterceptor.invoke() method is accumulating AsyncInvocationIdUUIDImpl objects until the JVM's heap explodes.

      Attachments

        Activity

          People

            Unassigned Unassigned
            chrisjr_jira Chris Rankin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: