File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
hadoop-common-project/hadoop-common/src
main/java/org/apache/hadoop/ipc
test/java/org/apache/hadoop/ipc Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1907,10 +1907,12 @@ public ByteBuffer readResponse() throws IOException {
19071907 }
19081908 }
19091909 if (length <= 0 ) {
1910- throw new RpcException ("RPC response has invalid length" );
1910+ throw new RpcException (String .format ("RPC response has " +
1911+ "invalid length of %d" , length ));
19111912 }
19121913 if (maxResponseLength > 0 && length > maxResponseLength ) {
1913- throw new RpcException ("RPC response exceeds maximum data length" );
1914+ throw new RpcException (String .format ("RPC response has a " +
1915+ "length of %d exceeds maximum data length" , length ));
19141916 }
19151917 ByteBuffer bb = ByteBuffer .allocate (length );
19161918 in .readFully (bb .array ());
Original file line number Diff line number Diff line change @@ -1638,8 +1638,8 @@ public void testRpcResponseLimit() throws Throwable {
16381638 } catch (IOException ioe ) {
16391639 Assert .assertNotNull (ioe );
16401640 Assert .assertEquals (RpcException .class , ioe .getClass ());
1641- Assert .assertEquals ( "RPC response exceeds maximum data length" ,
1642- ioe . getMessage ( ));
1641+ Assert .assertTrue ( ioe . getMessage (). contains (
1642+ "exceeds maximum data length" ));
16431643 return ;
16441644 }
16451645 Assert .fail ("didn't get limit exceeded" );
You can’t perform that action at this time.
0 commit comments