[jboss-jira] [JBoss JIRA] (JBAS-9491) JBoss 6.0.0-Final leaks an AsyncInvocationIdUUIDImpl object for every asynchronous call

Chris Rankin (JIRA) jira-events at lists.jboss.org
Wed May 2 10:29:20 EDT 2012


     [ https://issues.jboss.org/browse/JBAS-9491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Rankin updated JBAS-9491:
-------------------------------

    Steps to Reproduce: 
Basically, {{AsyncInvocationIdUUIDImpl}} fails the following JUnit test:
{code:Java}
@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());
}
{code}

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

  was:
Basically, {{AsyncInvocationIdUUIDImpl}} fails the following JUnit test:
{code:Java}
@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());
}
{code}

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


    
> JBoss 6.0.0-Final leaks an AsyncInvocationIdUUIDImpl object for every asynchronous call
> ---------------------------------------------------------------------------------------
>
>                 Key: JBAS-9491
>                 URL: https://issues.jboss.org/browse/JBAS-9491
>             Project: Application Server 3  4  5 and 6
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: EJB
>    Affects Versions: 6.0.0.Final
>         Environment: CentOS, Windows7
>            Reporter: Chris Rankin
>            Assignee: Carlo de Wolf
>
> The {{AsyncInvocationIdUUIDImpl.equals()}} method is implemented as:
> {code:Java}
> @Override
> public boolean equals(final Object obj) {
>     return uuid.equals(obj);
> }
> {code}
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list