Browse Source

HADOOP-3434. Retain the cause of the bind failure in Server::bind.
Contributed by Steve Loughran.



git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@661540 13f79535-47bb-0310-9956-ffa450edef68

Christopher Douglas 17 years ago
parent
commit
b2d7bc78bc
2 changed files with 7 additions and 1 deletions
  1. 3 0
      CHANGES.txt
  2. 4 1
      src/java/org/apache/hadoop/ipc/Server.java

+ 3 - 0
CHANGES.txt

@@ -179,6 +179,9 @@ Trunk (unreleased changes)
     datanode, now can report corrupt replicas received from src node to
     datanode, now can report corrupt replicas received from src node to
     the namenode. (Lohit Vijayarenu via rangadi)
     the namenode. (Lohit Vijayarenu via rangadi)
 
 
+    HADOOP-3434. Retain the cause of the bind failure in Server::bind.
+    (Steve Loughran via cdouglas)
+
   OPTIMIZATIONS
   OPTIMIZATIONS
 
 
     HADOOP-3274. The default constructor of BytesWritable creates empty 
     HADOOP-3274. The default constructor of BytesWritable creates empty 

+ 4 - 1
src/java/org/apache/hadoop/ipc/Server.java

@@ -165,7 +165,10 @@ public abstract class Server {
     try {
     try {
       socket.bind(address, backlog);
       socket.bind(address, backlog);
     } catch (BindException e) {
     } catch (BindException e) {
-      throw new BindException("Problem binding to " + address);
+      BindException bindException = new BindException("Problem binding to " + address
+                                                      + " : " + e.getMessage());
+      bindException.initCause(e);
+      throw bindException;
     } catch (SocketException e) {
     } catch (SocketException e) {
       // If they try to bind to a different host's address, give a better
       // If they try to bind to a different host's address, give a better
       // error message.
       // error message.