hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todd Lipcon (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-7086) Retrying socket connection failure times can be made as configurable
Date Thu, 31 Mar 2011 02:44:06 GMT

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

Todd Lipcon commented on HADOOP-7086:
-------------------------------------

Hi Devaraj. I think this is a good idea to make configurable.

- Can you please try to use Mockito rather than make a new TestSocketFactory in the test case?
You can do something like:

{code}
SocketFactory mockFactory = Mockito.mock(new SocketFactory());
doThrow(new SocketTimeoutException()).when(mockFactory).createSocket();
Client client = new Client(..., mockFactory);
....
Mockito.verify(mockFactory, Mockito.times(noOfSocketRetries)).createSocket();
{code}

This is a bit more concise I think.

- Also, the patch attached here makes a number of spurious whitespace changes which should
be ommitted.
- I don't think the name "ipc.client.connect.max.socket.retries" is very good - it's not clear
how it's different from "ipc.client.connect.max.retries" which already exists. Maybe a better
name would be "ipc.client.connect.max.retries.on.timeouts"?
- There's a typo in the description of the parameter: "make to establish a server connection".
Perhaps "Indicates the number of times a client will retry when encountering a socket timeout
while connecting to an IPC server."

> Retrying socket connection failure times can be made as configurable
> --------------------------------------------------------------------
>
>                 Key: HADOOP-7086
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7086
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: conf
>    Affects Versions: 0.21.0
>         Environment: NA
>            Reporter: Devaraj K
>            Assignee: Devaraj K
>            Priority: Minor
>         Attachments: common-3899.patch
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> Retrying socket connection failure times are hard coded as 45 and it is giving the retryring
message for 45 times as below. 
> 2011-01-04 15:14:30,700 INFO ipc.Client (Client.java:handleConnectionFailure(487)) -
Retrying connect to server: /10.18.52.124:50020. Already tried 1 time(s).
> This can be made as configurable and also we can keep the default value as 45. If the
user wants to decrease/increase,  they can add this configurable property otherwise it can
continue with the default value.
> common\src\java\org\apache\hadoop\ipc\Client.java:
> -----------------------------------------------------------------------
> private synchronized void setupConnection() throws IOException {
>       short ioFailures = 0;
>       short timeoutFailures = 0;
>       while (true) {
>         try {
>           this.socket = socketFactory.createSocket();
>           this.socket.setTcpNoDelay(tcpNoDelay);
>           // connection time out is 20s
>           NetUtils.connect(this.socket, remoteId.getAddress(), 20000);
>           if (rpcTimeout > 0) {
>             pingInterval = rpcTimeout;  // rpcTimeout overwrites pingInterval
>           }
>           this.socket.setSoTimeout(pingInterval);
>           return;
>         } catch (SocketTimeoutException toe) {
>           /*
>            * The max number of retries is 45, which amounts to 20s*45 = 15
>            * minutes retries.
>            */
>           handleConnectionFailure(timeoutFailures++, 45, toe);
>         } catch (IOException ie) {
>           handleConnectionFailure(ioFailures++, maxRetries, ie);
>         }
>       }
>     }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message