[ 
https://issues.apache.org/jira/browse/HDFS-6378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Abhiraj Butala updated HDFS-6378:
---------------------------------

    Attachment: HDFS-6378.002.patch

Thanks for the feedback Brandon. Attaching a patch which addresses your 
comments. Also, I moved the Shutdown hook registration to be after the 
registration itself, because it would be redundant if the registration itself 
exited with exception. Finally, I have removed some extra white spaces.

Here are some outputs:

1. 'hdfs nfs3' without starting 'hdfs portmap':

{code}
14/07/02 02:02:01 INFO nfs3.Nfs3Base: NFS server port set to: 2049
14/07/02 02:02:01 INFO oncrpc.RpcProgram: Will accept client connections from 
unprivileged ports
14/07/02 02:02:02 INFO oncrpc.SimpleUdpServer: Started listening to UDP 
requests at port 4242 for Rpc program: mountd at localhost:4242 with 
workerCount 1
14/07/02 02:02:02 INFO oncrpc.SimpleTcpServer: Started listening to TCP 
requests at port 4242 for Rpc program: mountd at localhost:4242 with 
workerCount 1
14/07/02 02:02:03 ERROR oncrpc.RpcProgram: Registration failure with 
localhost:4242, portmap entry: (PortmapMapping-100005:1:17:4242)
14/07/02 02:02:03 FATAL mount.MountdBase: Failed to start the server. Cause:
java.lang.RuntimeException: Registration failure
        at org.apache.hadoop.oncrpc.RpcProgram.register(RpcProgram.java:135)
        at org.apache.hadoop.oncrpc.RpcProgram.register(RpcProgram.java:101)
        at org.apache.hadoop.mount.MountdBase.start(MountdBase.java:79)
        at 
org.apache.hadoop.hdfs.nfs.nfs3.Nfs3.startServiceInternal(Nfs3.java:55)
        at org.apache.hadoop.hdfs.nfs.nfs3.Nfs3.startService(Nfs3.java:68)
        at org.apache.hadoop.hdfs.nfs.nfs3.Nfs3.main(Nfs3.java:72)
Caused by: java.net.SocketTimeoutException: Receive timed out
        at java.net.PlainDatagramSocketImpl.receive0(Native Method)
        at 
java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:145)
        at java.net.DatagramSocket.receive(DatagramSocket.java:786)
        at org.apache.hadoop.oncrpc.SimpleUdpClient.run(SimpleUdpClient.java:66)
        at org.apache.hadoop.oncrpc.RpcProgram.register(RpcProgram.java:130)
        ... 5 more
14/07/02 02:02:03 INFO nfs3.Nfs3Base: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down Nfs3 at abutala-vBox/127.0.1.1
************************************************************/
{code}

2. Started both portmap and nfs3. Then closed portmap first and did Ctrl-C on 
nfs3:

{code}
14/07/02 02:02:41 INFO nfs3.Nfs3Base: NFS server port set to: 2049
14/07/02 02:02:41 INFO oncrpc.RpcProgram: Will accept client connections from 
unprivileged ports
14/07/02 02:02:42 INFO oncrpc.SimpleUdpServer: Started listening to UDP 
requests at port 4242 for Rpc program: mountd at localhost:4242 with 
workerCount 1
14/07/02 02:02:42 INFO oncrpc.SimpleTcpServer: Started listening to TCP 
requests at port 4242 for Rpc program: mountd at localhost:4242 with 
workerCount 1
14/07/02 02:02:42 INFO oncrpc.SimpleTcpServer: Started listening to TCP 
requests at port 2049 for Rpc program: NFS3 at localhost:2049 with workerCount 0
^C14/07/02 02:02:52 ERROR nfs3.Nfs3Base: RECEIVED SIGNAL 2: SIGINT
14/07/02 02:02:53 ERROR oncrpc.RpcProgram: Unregistration failure with 
localhost:4242, portmap entry: (PortmapMapping-100005:1:17:4242)
14/07/02 02:02:53 WARN util.ShutdownHookManager: ShutdownHook 'Unregister' 
failed, java.lang.RuntimeException: Unregistration failure
java.lang.RuntimeException: Unregistration failure
        at org.apache.hadoop.oncrpc.RpcProgram.register(RpcProgram.java:135)
        at org.apache.hadoop.oncrpc.RpcProgram.unregister(RpcProgram.java:118)
        at org.apache.hadoop.mount.MountdBase$Unregister.run(MountdBase.java:98)
        at 
org.apache.hadoop.util.ShutdownHookManager$1.run(ShutdownHookManager.java:54)
Caused by: java.net.SocketTimeoutException: Receive timed out
        at java.net.PlainDatagramSocketImpl.receive0(Native Method)
        at 
java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:145)
        at java.net.DatagramSocket.receive(DatagramSocket.java:786)
        at org.apache.hadoop.oncrpc.SimpleUdpClient.run(SimpleUdpClient.java:66)
        at org.apache.hadoop.oncrpc.RpcProgram.register(RpcProgram.java:130)
        ... 3 more
14/07/02 02:02:53 ERROR oncrpc.RpcProgram: Unregistration failure with 
localhost:2049, portmap entry: (PortmapMapping-100003:3:6:2049)
14/07/02 02:02:53 WARN util.ShutdownHookManager: ShutdownHook 'Unregister' 
failed, java.lang.RuntimeException: Unregistration failure
java.lang.RuntimeException: Unregistration failure
        at org.apache.hadoop.oncrpc.RpcProgram.register(RpcProgram.java:135)
        at org.apache.hadoop.oncrpc.RpcProgram.unregister(RpcProgram.java:118)
        at org.apache.hadoop.nfs.nfs3.Nfs3Base$Unregister.run(Nfs3Base.java:78)
        at 
org.apache.hadoop.util.ShutdownHookManager$1.run(ShutdownHookManager.java:54)
Caused by: java.net.SocketTimeoutException: Receive timed out
        at java.net.PlainDatagramSocketImpl.receive0(Native Method)
        at 
java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:145)
        at java.net.DatagramSocket.receive(DatagramSocket.java:786)
        at org.apache.hadoop.oncrpc.SimpleUdpClient.run(SimpleUdpClient.java:66)
        at org.apache.hadoop.oncrpc.RpcProgram.register(RpcProgram.java:130)
        ... 3 more
14/07/02 02:02:53 INFO nfs3.Nfs3Base: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down Nfs3 at abutala-vBox/127.0.1.1
************************************************************/
{code}

> NFS: when portmap/rpcbind is not available, NFS registration should timeout 
> instead of hanging 
> -----------------------------------------------------------------------------------------------
>
>                 Key: HDFS-6378
>                 URL: https://issues.apache.org/jira/browse/HDFS-6378
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: nfs
>            Reporter: Brandon Li
>            Assignee: Abhiraj Butala
>         Attachments: HDFS-6378.002.patch, HDFS-6378.patch
>
>
> When portmap/rpcbind is not available, NFS could be stuck at registration. 
> Instead, NFS gateway should shut down automatically with proper error message.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to