Return-Path: Delivered-To: apmail-hadoop-core-commits-archive@www.apache.org Received: (qmail 39907 invoked from network); 12 Aug 2008 22:13:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Aug 2008 22:13:02 -0000 Received: (qmail 74811 invoked by uid 500); 12 Aug 2008 22:13:00 -0000 Delivered-To: apmail-hadoop-core-commits-archive@hadoop.apache.org Received: (qmail 74792 invoked by uid 500); 12 Aug 2008 22:13:00 -0000 Mailing-List: contact core-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-commits@hadoop.apache.org Received: (qmail 74783 invoked by uid 99); 12 Aug 2008 22:13:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Aug 2008 15:13:00 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Tue, 12 Aug 2008 22:12:13 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 354B72388A03; Tue, 12 Aug 2008 15:12:11 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r685342 - in /hadoop/core/trunk: CHANGES.txt src/core/org/apache/hadoop/ipc/Client.java src/test/org/apache/hadoop/ipc/TestIPC.java Date: Tue, 12 Aug 2008 22:12:10 -0000 To: core-commits@hadoop.apache.org From: omalley@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080812221211.354B72388A03@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: omalley Date: Tue Aug 12 15:12:10 2008 New Revision: 685342 URL: http://svn.apache.org/viewvc?rev=685342&view=rev Log: HADOOP-3844. Include message of local exception in RPC client failures. (Steve Loughran via omalley) Modified: hadoop/core/trunk/CHANGES.txt hadoop/core/trunk/src/core/org/apache/hadoop/ipc/Client.java hadoop/core/trunk/src/test/org/apache/hadoop/ipc/TestIPC.java Modified: hadoop/core/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=685342&r1=685341&r2=685342&view=diff ============================================================================== --- hadoop/core/trunk/CHANGES.txt (original) +++ hadoop/core/trunk/CHANGES.txt Tue Aug 12 15:12:10 2008 @@ -178,6 +178,9 @@ HADOOP-3852. Add ShellCommandExecutor.toString method to make nicer error messages. (Steve Loughran via omalley) + HADOOP-3844. Include message of local exception in RPC client failures. + (Steve Loughran via omalley) + OPTIMIZATIONS HADOOP-3556. Removed lock contention in MD5Hash by changing the Modified: hadoop/core/trunk/src/core/org/apache/hadoop/ipc/Client.java URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/ipc/Client.java?rev=685342&r1=685341&r2=685342&view=diff ============================================================================== --- hadoop/core/trunk/src/core/org/apache/hadoop/ipc/Client.java (original) +++ hadoop/core/trunk/src/core/org/apache/hadoop/ipc/Client.java Tue Aug 12 15:12:10 2008 @@ -708,7 +708,9 @@ throw call.error; } else { // local exception throw (IOException)new IOException( - "Call failed on local exception").initCause(call.error); + "Call to "+ addr + " failed on local exception: " + + call.error.getMessage()) + .initCause(call.error); } } else { return call.value; Modified: hadoop/core/trunk/src/test/org/apache/hadoop/ipc/TestIPC.java URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/ipc/TestIPC.java?rev=685342&r1=685341&r2=685342&view=diff ============================================================================== --- hadoop/core/trunk/src/test/org/apache/hadoop/ipc/TestIPC.java (original) +++ hadoop/core/trunk/src/test/org/apache/hadoop/ipc/TestIPC.java Tue Aug 12 15:12:10 2008 @@ -211,16 +211,25 @@ public void testStandAloneClient() throws Exception { testParallel(10, false, 2, 4, 2, 4, 100); Client client = new Client(LongWritable.class, conf); - boolean hasException = false; + InetSocketAddress address = new InetSocketAddress("127.0.0.1", 10); try { - client.call(new LongWritable(RANDOM.nextLong()), - new InetSocketAddress("127.0.0.1", 10)); + client.call(new LongWritable(RANDOM.nextLong()), + address); + fail("Expected an exception to have been thrown"); } catch (IOException e) { - hasException = true; + String message = e.getMessage(); + String addressText = address.toString(); + assertTrue("Did not find "+addressText+" in "+message, + message.contains(addressText)); + Throwable cause=e.getCause(); + assertNotNull("No nested exception in "+e,cause); + String causeText=cause.getMessage(); + assertTrue("Did not find " + causeText + " in " + message, + message.contains(causeText)); } - assertTrue (hasException); } + public static void main(String[] args) throws Exception { //new TestIPC("test").testSerial(5, false, 2, 10, 1000);