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

Jason Lowe commented on HADOOP-14926:
-------------------------------------

I do not see how zero would be a valid timeout.  The RPC call would immediately 
timeout before it has even reached the remote server, preventing any RPC call 
from succeeding.

Many systems implement zero timeout as an indefinite wait when zero makes no 
sense.  Besides Java's socket libs, the {{wait}} builtin does this as well, 
since it doesn't make sense to wait if there's no time that will elapse -- 
simply don't call {{wait}} if you do not want to wait.  Similarly, it makes no 
sense to try to complete an RPC call in zero time.

I don't see how we can change the interpretation of zero without breaking 
compatibility, and I also don't see how a literally zero-wait timeout is useful 
to configure in practice since every RPC call will fail.  If we want to add -1 
as yet another way to specify an infinite wait that's fine with me, but 
changing the interpretation of zero will be problematic for dubious benefit.


> Reconsider the default value of RPC timeout and document it
> -----------------------------------------------------------
>
>                 Key: HADOOP-14926
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14926
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: common
>    Affects Versions: 2.8.1, 3.0.0-alpha3
>            Reporter: Yufei Gu
>
> We use zero as the default value of RPC timeout, which mean we don't enforce 
> any timeout aka infinity timeout. I think that *zero means infinite* is 
> counter-intuitive and error-prone through some Java libs(e.g. Socket 
> #setSoTimeout()) do that as well. Zero could be considered as a valid timeout 
> value, while negative one isn't. If we use zero to represent infinite, which 
> number could be used to represent zero timeout? I suggest use -1 as the 
> default value to indicate infinite. 
> We also need to document the default value and it means infinite timeout. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to