Skip to content
  • Chuck Lever's avatar
    SUNRPC: Allow RPCs to fail quickly if the server is unreachable · 09a21c41
    Chuck Lever authored
    
    
    The kernel sometimes makes RPC calls to services that aren't running.
    Because the kernel's RPC client always assumes the hard retry semantic
    when reconnecting a connection-oriented RPC transport, the underlying
    reconnect logic takes a long while to time out, even though the remote
    may have responded immediately with ECONNREFUSED.
    
    In certain cases, like upcalls to our local rpcbind daemon, or for NFS
    mount requests, we'd like the kernel to fail immediately if the remote
    service isn't reachable.  This allows another transport to be tried
    immediately, or the pending request can be abandoned quickly.
    
    Introduce a per-request flag which controls how call_transmit_status()
    behaves when request transmission fails because the server cannot be
    reached.
    
    We don't want soft connection semantics to apply to other errors.  The
    default case of the switch statement in call_transmit_status() no
    longer falls through; the fall through code is copied to the default
    case, and a "break;" is added.
    
    The transport's connection re-establishment timeout is also ignored for
    such requests.  We want the request to fail immediately, so the
    reconnect delay is skipped.  Additionally, we don't want a connect
    failure here to further increase the reconnect timeout value, since
    this request will not be retried.
    
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
    09a21c41