[jboss-jira] [JBoss JIRA] Updated: (JGRP-707) stats logic NPE in NAKACK

Gray Watson (JIRA) jira-events at lists.jboss.org
Tue Mar 11 11:35:57 EDT 2008


     [ http://jira.jboss.com/jira/browse/JGRP-707?page=all ]

Gray Watson updated JGRP-707:
-----------------------------

    Attachment: NAKACK.java.patch

This patch fixes the NPE although it is important to note that race conditions in a lot of the logic for putIfAbsent mean that the first couple of packets for each address may not be recorded correctly.

Something like the following logic needs to be in a ton of places in the code but this may not be necessary for statistics.

         StatsEntry entry=map.get(key);                                                                                                                           
         if(entry == null) {                                                                                                                                      
             entry = new StatsEntry();                                                                                                                            
             StatsEntry entry2 = map.putIfAbsent(key, entry);                                                                                                                 
             if (entry2 != null)
                 entry = entry2;
         }                                                                                                                                                        
         entry.xmit_reqs+=req;                                                                                                                                    
         ....


> stats logic NPE in NAKACK
> -------------------------
>
>                 Key: JGRP-707
>                 URL: http://jira.jboss.com/jira/browse/JGRP-707
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 2.6.1
>            Reporter: Gray Watson
>         Assigned To: Bela Ban
>            Priority: Minor
>         Attachments: NAKACK.java.patch
>
>
> In the code for NAKACK, the first packet which is recorded as part of the stats for an address throws NPE.
>         StatsEntry entry=map.get(key);
>         if(entry == null) {
>             entry = new StatsEntry();
>             entry = map.putIfAbsent(key, entry);
>            // ^^^^ this can return null if key does not exist
>         }
>         entry.xmit_reqs+=req;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list