Hi guys,
So debugging some fun issues in my dev cluster, I discovered that due to some
bad user data, my AuthenticationProvider was throwing a null pointer exception
inside the handleAuthentication call. This call is made inside of
NIOServerCnxn.readRequest, and there is no try catch block. So it bubbles all
the way up to the NIOServerCnxn run method, which only logs it. Eventually I
end up with the corrupted request buffer I sent earlier:
2011-08-12 08:01:16,602 - ERROR [CommitProcessor:4:FinalRequestProcessor@347] -
Failed to process sessionid:0x5319dd2bf3403f4 type:exists cxid:0x0
zxid:0xfffffffffffffffe txntype:unknown reqpath:n/a
java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:180)
at java.io.DataInputStream.readFully(DataInputStream.java:152)
at
org.apache.jute.BinaryInputArchive.readString(BinaryInputArchive.java:82)
at
org.apache.zookeeper.proto.ExistsRequest.deserialize(ExistsRequest.java:55)
at
org.apache.zookeeper.server.ZooKeeperServer.byteBuffer2Record(ZooKeeperServer.java:599)
at
org.apache.zookeeper.server.FinalRequestProcessor.processRequest(FinalRequestProcessor.java:227)
at
org.apache.zookeeper.server.quorum.Leader$ToBeAppliedRequestProcessor.processRequest(Leader.java:540)
at
org.apache.zookeeper.server.quorum.CommitProcessor.run(CommitProcessor.java:73)
2011-08-12 08:01:16,602 - ERROR [CommitProcessor:4:FinalRequestProcessor@354] -
Dumping request buffer: 0x504150ffffffff
I suspect this is due to the fact that, in the readPayload method, we don't
call clear on lenBuffer when an exception is thrown by readRequest.
Question:
Obviously, I need to fix the exception that is being thrown by my
AuthenticationProvider, but do we want to put some try/catch logic around that
call? It seems like the error there is probably contributing to my corrupted
buffer problem.
C