avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r1166337 - in /avro/branches/branch-1.5: ./ CHANGES.txt lang/java/ipc/src/main/java/org/apache/avro/ipc/Requestor.java lang/java/ipc/src/test/java/org/apache/avro/TestProtocolSpecific.java
Date Wed, 07 Sep 2011 19:43:24 GMT
Author: cutting
Date: Wed Sep  7 19:43:24 2011
New Revision: 1166337

URL: http://svn.apache.org/viewvc?rev=1166337&view=rev
Log:
Merge -c 1166326 from trunk  to 1.5 branch.  Fixes: AVRO-884.

Modified:
    avro/branches/branch-1.5/   (props changed)
    avro/branches/branch-1.5/CHANGES.txt
    avro/branches/branch-1.5/lang/java/ipc/src/main/java/org/apache/avro/ipc/Requestor.java
    avro/branches/branch-1.5/lang/java/ipc/src/test/java/org/apache/avro/TestProtocolSpecific.java

Propchange: avro/branches/branch-1.5/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  7 19:43:24 2011
@@ -1 +1 @@
-/avro/trunk:1075938,1075993,1078917,1079055,1079060,1079063,1079680,1083246,1085921,1086727,1086730,1086866,1087076,1087129,1087136,1087439-1087440,1087463,1087472,1087792,1089128,1089131,1089550,1094812,1095206-1095208,1095493,1095529,1095548,1095550,1096798,1097916,1097927,1097968,1097974,1099257,1102332,1102335,1124127,1124971,1129053,1129071,1129697-1129706,1129729,1129856,1130503,1136342,1141619,1141677,1141685,1141979-1141980,1142057,1142063,1151660,1151983,1157245,1161743,1161755,1161764,1161769-1161770,1161779
+/avro/trunk:1075938,1075993,1078917,1079055,1079060,1079063,1079680,1083246,1085921,1086727,1086730,1086866,1087076,1087129,1087136,1087439-1087440,1087463,1087472,1087792,1089128,1089131,1089550,1094812,1095206-1095208,1095493,1095529,1095548,1095550,1096798,1097916,1097927,1097968,1097974,1099257,1102332,1102335,1124127,1124971,1129053,1129071,1129697-1129706,1129729,1129856,1130503,1136342,1141619,1141677,1141685,1141979-1141980,1142057,1142063,1151660,1151983,1157245,1161743,1161755,1161764,1161769-1161770,1161779,1166326

Modified: avro/branches/branch-1.5/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/CHANGES.txt?rev=1166337&r1=1166336&r2=1166337&view=diff
==============================================================================
--- avro/branches/branch-1.5/CHANGES.txt (original)
+++ avro/branches/branch-1.5/CHANGES.txt Wed Sep  7 19:43:24 2011
@@ -1,5 +1,12 @@
 Avro Change Log
 
+Avro 1.5.4 (unreleased)
+
+  BUG FIXES
+
+    AVRO-884.  Java: Fix a regression in RPC so that one-way messages
+    fail when the transciever cannot connect. (Tom White via cutting)
+
 Avro 1.5.3 (25 August 2011)
 
   IMPROVEMENTS

Modified: avro/branches/branch-1.5/lang/java/ipc/src/main/java/org/apache/avro/ipc/Requestor.java
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/lang/java/ipc/src/main/java/org/apache/avro/ipc/Requestor.java?rev=1166337&r1=1166336&r2=1166337&view=diff
==============================================================================
--- avro/branches/branch-1.5/lang/java/ipc/src/main/java/org/apache/avro/ipc/Requestor.java
(original)
+++ avro/branches/branch-1.5/lang/java/ipc/src/main/java/org/apache/avro/ipc/Requestor.java
Wed Sep  7 19:43:24 2011
@@ -149,6 +149,16 @@ public abstract class Requestor {
                        new TransceiverCallback<T>(request, callFuture));
           // Block until handshake complete
           callFuture.await();
+          if (request.getMessage().isOneWay()) {
+            Throwable error = callFuture.getError();
+            if (error != null) {
+              if (error instanceof Exception) {
+                throw (Exception) error;
+              } else {
+                throw new AvroRemoteException(error);
+              }
+            }
+          }
           return;
         }
       } finally{

Modified: avro/branches/branch-1.5/lang/java/ipc/src/test/java/org/apache/avro/TestProtocolSpecific.java
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/lang/java/ipc/src/test/java/org/apache/avro/TestProtocolSpecific.java?rev=1166337&r1=1166336&r2=1166337&view=diff
==============================================================================
--- avro/branches/branch-1.5/lang/java/ipc/src/test/java/org/apache/avro/TestProtocolSpecific.java
(original)
+++ avro/branches/branch-1.5/lang/java/ipc/src/test/java/org/apache/avro/TestProtocolSpecific.java
Wed Sep  7 19:43:24 2011
@@ -17,6 +17,7 @@
  */
 package org.apache.avro;
 
+import org.apache.avro.ipc.HttpTransceiver;
 import org.apache.avro.ipc.RPCContext;
 import org.apache.avro.ipc.RPCPlugin;
 import org.apache.avro.ipc.Requestor;
@@ -50,6 +51,7 @@ import java.io.FileWriter;
 import java.io.IOException;
 import java.io.LineNumberReader;
 import java.net.InetSocketAddress;
+import java.net.URL;
 import java.nio.ByteBuffer;
 import java.util.Random;
 import java.util.List;
@@ -216,6 +218,15 @@ public class TestProtocolSpecific {
       proxy.hello("hi!");
     }
   }
+  
+  @Test(expected = Exception.class)
+  public void testConnectionRefusedOneWay() throws IOException {
+    Transceiver client = new HttpTransceiver(new URL("http://localhost:4444"));
+    SpecificRequestor req = new SpecificRequestor(Simple.class, client);
+    addRpcPlugins(req);
+    Simple proxy = SpecificRequestor.getClient(Simple.class, (SpecificRequestor)req);
+    proxy.ack();
+  }
 
   @Test
   /** Construct and use a protocol whose "hello" method has an extra



Mime
View raw message