HBASE-16159 OutOfMemory exception when using AsyncRpcClient with encryption to read rpc response (Colin Ma)

This commit is contained in:
tedyu 2016-07-01 14:26:09 -07:00
parent fe75edb556
commit af9422c04a
1 changed files with 4 additions and 0 deletions

View File

@ -216,6 +216,8 @@ public class SaslClientHandler extends ChannelDuplexHandler {
writeSaslToken(ctx, saslToken); writeSaslToken(ctx, saslToken);
} }
} }
// release the memory
in.release();
if (saslClient.isComplete()) { if (saslClient.isComplete()) {
String qop = (String) saslClient.getNegotiatedProperty(Sasl.QOP); String qop = (String) saslClient.getNegotiatedProperty(Sasl.QOP);
@ -246,6 +248,8 @@ public class SaslClientHandler extends ChannelDuplexHandler {
} }
saslToken = new byte[length]; saslToken = new byte[length];
in.readBytes(saslToken); in.readBytes(saslToken);
// release the memory
in.release();
} catch (IndexOutOfBoundsException e) { } catch (IndexOutOfBoundsException e) {
return; return;
} }