You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by zh...@apache.org on 2017/06/30 05:10:55 UTC

[bookkeeper] branch master updated: ISSUE #198: TestBackwardCompat.testCompat410 often fails due to io.netty.util.IllegalReferenceCountException

This is an automated email from the ASF dual-hosted git repository.

zhaijia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 1b0492b  ISSUE #198: TestBackwardCompat.testCompat410 often fails due to io.netty.util.IllegalReferenceCountException
1b0492b is described below

commit 1b0492bf2ac547cf583736d3eaf9849498e42f80
Author: Sijie Guo <si...@apache.org>
AuthorDate: Fri Jun 30 13:10:42 2017 +0800

    ISSUE #198: TestBackwardCompat.testCompat410 often fails due to io.netty.util.IllegalReferenceCountException
    
    Descriptions of the changes in this PR:
    
    Problem:
    
    in TestBackwardCompat#testCompact400, the test is to verify the current client can't talk to a 4.0.0 server.
    
    The 4.5.0 client is sending a protobuf encoded request to 4.0.0 server. The 4.0.0 server will interpret the 4.5.0 protobuf encoded request, but it will realize this is bad request and sending v2 protocol encoded response. because the request is a bad request, 4.0.0 server sent a response back with unknown op code.
    
    In current v2 ResponseEnDecoder (listed as below), when it doesn't know the op code, it will return the buffer to the channel. this might cause the misbehavior in the channel pipeline to decrement reference count.
    
    Solution:
    
    throw exception in the EnDeCoder when receiving unknown op code. so the netty can close the connection, error out the pending requests and cleaning up the resources.
    
    Author: Sijie Guo <si...@apache.org>
    
    Reviewers: Matteo Merli <None>
    
    This closes #219 from sijie/issue_198, closes #198
---
 .../src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java
index e1ccabc..8988cc9 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java
@@ -283,7 +283,7 @@ public class BookieProtoEncoding {
                 BookkeeperProtocol.AuthMessage am = builder.build();
                 return new BookieProtocol.AuthResponse(version, am);
             default:
-                return buffer;
+                throw new IllegalStateException("Received unknown response : op code = " + opCode);
             }
         }
     }

-- 
To stop receiving notification emails like this one, please contact
['"commits@bookkeeper.apache.org" <co...@bookkeeper.apache.org>'].