Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 055A3D77E for ; Thu, 16 May 2013 01:32:38 +0000 (UTC) Received: (qmail 91051 invoked by uid 500); 16 May 2013 01:32:37 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 91006 invoked by uid 500); 16 May 2013 01:32:37 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 90999 invoked by uid 99); 16 May 2013 01:32:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 May 2013 01:32:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 May 2013 01:32:35 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D16E2238890D; Thu, 16 May 2013 01:32:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1483144 - in /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common: ./ dev-support/ src/main/docs/ src/main/java/ src/main/java/org/apache/hadoop/ipc/ src/main/proto/ src/test/core/ Date: Thu, 16 May 2013 01:32:15 -0000 To: common-commits@hadoop.apache.org From: sradia@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130516013215.D16E2238890D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sradia Date: Thu May 16 01:32:14 2013 New Revision: 1483144 URL: http://svn.apache.org/r1483144 Log: Merged HADOOP-9151 Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/ (props changed) hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt (contents, props changed) hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/dev-support/findbugsExcludeFile.xml hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/docs/ (props changed) hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/ (props changed) hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/proto/RpcHeader.proto hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/core/ (props changed) Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/ ------------------------------------------------------------------------------ Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common:r1454593 Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1483144&r1=1483143&r2=1483144&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt Thu May 16 01:32:14 2013 @@ -7,6 +7,9 @@ Release 2.0.5-beta - UNRELEASED HADOOP-9163 The rpc msg in ProtobufRpcEngine.proto should be moved out to avoid an extra copy (Sanjay Radia) + HADOOP-9151 Include RPC error info in RpcResponseHeader instead of sending + it separately (sanjay Radia) + NEW FEATURES HADOOP-9194. RPC support for QoS. (Junping Du via llu) Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt ------------------------------------------------------------------------------ Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt:r1454593 Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/dev-support/findbugsExcludeFile.xml URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/dev-support/findbugsExcludeFile.xml?rev=1483144&r1=1483143&r2=1483144&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/dev-support/findbugsExcludeFile.xml (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/dev-support/findbugsExcludeFile.xml Thu May 16 01:32:14 2013 @@ -320,4 +320,11 @@ + + + + + + + Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/docs/ ------------------------------------------------------------------------------ Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/docs:r1454593 Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/ ------------------------------------------------------------------------------ Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java:r1454593 Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java?rev=1483144&r1=1483143&r2=1483144&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java Thu May 16 01:32:14 2013 @@ -59,7 +59,6 @@ import org.apache.hadoop.fs.CommonConfig import org.apache.hadoop.io.DataOutputBuffer; import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.io.Writable; -import org.apache.hadoop.io.WritableUtils; import org.apache.hadoop.io.retry.RetryPolicies; import org.apache.hadoop.io.retry.RetryPolicy; import org.apache.hadoop.io.retry.RetryPolicy.RetryAction; @@ -942,31 +941,38 @@ public class Client { touch(); try { - RpcResponseHeaderProto response = + RpcResponseHeaderProto header = RpcResponseHeaderProto.parseDelimitedFrom(in); - if (response == null) { + if (header == null) { throw new IOException("Response is null."); } - int callId = response.getCallId(); + int callId = header.getCallId(); if (LOG.isDebugEnabled()) LOG.debug(getName() + " got value #" + callId); Call call = calls.get(callId); - RpcStatusProto status = response.getStatus(); + RpcStatusProto status = header.getStatus(); if (status == RpcStatusProto.SUCCESS) { Writable value = ReflectionUtils.newInstance(valueClass, conf); value.readFields(in); // read value call.setRpcResponse(value); calls.remove(callId); - } else if (status == RpcStatusProto.ERROR) { - call.setException(new RemoteException(WritableUtils.readString(in), - WritableUtils.readString(in))); - calls.remove(callId); - } else if (status == RpcStatusProto.FATAL) { - // Close the connection - markClosed(new RemoteException(WritableUtils.readString(in), - WritableUtils.readString(in))); + } else { // Rpc Request failed + final String exceptionClassName = header.hasExceptionClassName() ? + header.getExceptionClassName() : + "ServerDidNotSetExceptionClassName"; + final String errorMsg = header.hasErrorMsg() ? + header.getErrorMsg() : "ServerDidNotSetErrorMsg" ; + RemoteException re = + new RemoteException(exceptionClassName, errorMsg); + if (status == RpcStatusProto.ERROR) { + call.setException(re); + calls.remove(callId); + } else if (status == RpcStatusProto.FATAL) { + // Close the connection + markClosed(re); + } } } catch (IOException e) { markClosed(e); Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java?rev=1483144&r1=1483143&r2=1483144&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java Thu May 16 01:32:14 2013 @@ -2024,6 +2024,7 @@ public abstract class Server { RpcResponseHeaderProto.newBuilder(); response.setCallId(call.callId); response.setStatus(status); + response.setServerIpcVersionNum(Server.CURRENT_VERSION); if (status == RpcStatusProto.SUCCESS) { @@ -2040,13 +2041,10 @@ public abstract class Server { StringUtils.stringifyException(t)); return; } - } else { - if (status == RpcStatusProto.FATAL) { - response.setServerIpcVersionNum(Server.CURRENT_VERSION); - } + } else { // Rpc Failure + response.setExceptionClassName(errorClass); + response.setErrorMsg(error); response.build().writeDelimitedTo(out); - WritableUtils.writeString(out, errorClass); - WritableUtils.writeString(out, error); } if (call.connection.useWrap) { wrapWithSasl(responseBuf, call); Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/proto/RpcHeader.proto URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/proto/RpcHeader.proto?rev=1483144&r1=1483143&r2=1483144&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/proto/RpcHeader.proto (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/proto/RpcHeader.proto Thu May 16 01:32:14 2013 @@ -70,12 +70,11 @@ message RpcRequestHeaderProto { // the h * | RpcResponseHeaderProto - serialized delimited ie has len | * +------------------------------------------------------------------+ * | if request is successful: | - * | - RpcResponse - The actual rpc response bytes | - * | This response is serialized based on RpcKindProto | + * | - RpcResponse - The actual rpc response bytes follow | + * the response header | + * | This response is serialized based on RpcKindProto | * | if request fails : | - * | - length (4 byte int) + Class name of exception - UTF-8 string | - * | - length (4 byte int) + Stacktrace - UTF-8 string | - * | if the strings are null then the length is -1 | + * | The rpc response header contains the necessary info | * +------------------------------------------------------------------+ * */ @@ -88,5 +87,7 @@ message RpcResponseHeaderProto { required uint32 callId = 1; // callId used in Request required RpcStatusProto status = 2; - optional uint32 serverIpcVersionNum = 3; // in case of an fatal IPC error + optional uint32 serverIpcVersionNum = 3; // Sent if success or fail + optional string exceptionClassName = 4; // if request fails + optional string errorMsg = 5; // if request fails, often contains strack trace } Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/core/ ------------------------------------------------------------------------------ Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/core:r1454593