[jboss-jira] [JBoss JIRA] (JGRP-1752) Concurrent message headers modification causes that message is never sent

Bela Ban (JIRA) jira-events at lists.jboss.org
Tue Dec 3 08:08:06 EST 2013


    [ https://issues.jboss.org/browse/JGRP-1752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928171#comment-12928171 ] 

Bela Ban edited comment on JGRP-1752 at 12/3/13 8:07 AM:
---------------------------------------------------------

Can be caused by the following interleaving of threads:
* T1: Message.putHeaderIfAbsent()
* T1: inserts key (id)
* T2: Message.resize(): copies old array (with key and (null) value)
* T1: sets value in old array
* T2: replaces old array with new one (key != null, value == null)

{{Message.putIfAbsent(K,V)}} only checks if K is null and sets V only if K == null. This will never set V.
SOLUTION: change {{Message.putHeaderIfAbsent()}}: if key != null but val == null -> set V anyway
                
      was (Author: belaban):
    Can be caused by the following interleaving of threads:
* T1: Message.putHeaderIfAbsent()
* T1: inserts key (id)
* T2: Message.resize(): copies old array (with key and (null) value)
* T1: sets value in old array
* T2: replaces old array with new one (key != null, value == null)

{{Message.putIfAbsent(K,V)}} only checks if K is null and sets V only if K == null. This will never set V.
SOLUTION: change to {{Message.putHeaderIfAbsent()}}: if key != null but val == null -> set V anyway
                  
> Concurrent message headers modification causes that message is never sent
> -------------------------------------------------------------------------
>
>                 Key: JGRP-1752
>                 URL: https://issues.jboss.org/browse/JGRP-1752
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 3.4.1
>            Reporter: Radim Vansa
>            Assignee: Bela Ban
>             Fix For: 3.5
>
>
> Under some circumstances the TP protocol may try to add the TP header to message twice concurrently.
> This happens for example when the stable message triggers retransmission while the message has been sent right now.
> This may result in ArrayOutOfBoundException in Headers._putHeader and/or subsequent NullPointerException in Headers.size(). The retransmission attempt always fails, the message is never delivered. Moreover, keeping this (and possibly following) messages in the transmission table can lead to OOME.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list