[ 
https://issues.apache.org/jira/browse/HADOOP-12605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15031594#comment-15031594
 ] 

Masatake Iwasaki commented on HADOOP-12605:
-------------------------------------------

{code}
    final int initialClients = readers + callQ + handlers;
    // max connections we should ever end up accepting at once
    final int maxAccept = initialClients + readers*readerQ + 1; // 1 = listener
{code}

The test expects that all readers' queue ({{pendingConnections}}) is full when 
Listener is blocked but the assumption is wrong. Listener put connections to 
queue (by {{Reader#addConnection}}) in round-robin along with 
{{Listener#getReader}}. Queued connections are processed in non-deterministic 
order by reader threads. If one of the reader's queue becomes full first then 
Listener trying to add connection to the queue will block even if other 
reader's queue have room. The number of connections accepted until Listener 
blocks could be less than the {{maxAccept}} due to this. ({{maxAccept > 
server.getNumOpenConnections()}})


> Fix intermittent failure of TestIPC.testIpcWithReaderQueuing
> ------------------------------------------------------------
>
>                 Key: HADOOP-12605
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12605
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: test
>            Reporter: Masatake Iwasaki
>            Assignee: Masatake Iwasaki
>            Priority: Minor
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to