From 1692dde435cbe861f03d1199859228671976a628 Mon Sep 17 00:00:00 2001 From: Jean-Daniel Cryans Date: Mon, 26 Mar 2012 17:39:36 +0000 Subject: [PATCH] HBASE-5190 Limit the IPC queue size based on calls' payload size (Ted's addendum) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1305468 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/hadoop/hbase/ipc/SecureServer.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/security/src/main/java/org/apache/hadoop/hbase/ipc/SecureServer.java b/security/src/main/java/org/apache/hadoop/hbase/ipc/SecureServer.java index 0766f5d23eb..bf45bb1fa5c 100644 --- a/security/src/main/java/org/apache/hadoop/hbase/ipc/SecureServer.java +++ b/security/src/main/java/org/apache/hadoop/hbase/ipc/SecureServer.java @@ -95,8 +95,8 @@ public abstract class SecureServer extends HBaseServer { protected class SecureCall extends HBaseServer.Call { public SecureCall(int id, Writable param, Connection connection, - Responder responder) { - super(id, param, connection, responder); + Responder responder, long size) { + super(id, param, connection, responder, size); } @Override @@ -205,7 +205,7 @@ public abstract class SecureServer extends HBaseServer { private final int AUTHORIZATION_FAILED_CALLID = -1; // Fake 'call' for SASL context setup private static final int SASL_CALLID = -33; - private final SecureCall saslCall = new SecureCall(SASL_CALLID, null, this, null); + private final SecureCall saslCall = new SecureCall(SASL_CALLID, null, this, null, 0); private boolean useWrap = false; @@ -414,7 +414,7 @@ public abstract class SecureServer extends HBaseServer { AccessControlException ae = new AccessControlException( "Authentication is required"); SecureCall failedCall = new SecureCall(AUTHORIZATION_FAILED_CALLID, null, this, - null); + null, 0); failedCall.setResponse(null, Status.FATAL, ae.getClass().getName(), ae.getMessage()); responder.doRespond(failedCall); @@ -595,7 +595,7 @@ public abstract class SecureServer extends HBaseServer { Writable param = ReflectionUtils.newInstance(paramClass, conf); // read param param.readFields(dis); - SecureCall call = new SecureCall(id, param, this, responder); + SecureCall call = new SecureCall(id, param, this, responder, buf.length); if (priorityCallQueue != null && getQosLevel(param) > highPriorityLevel) { priorityCallQueue.put(call); @@ -623,7 +623,7 @@ public abstract class SecureServer extends HBaseServer { LOG.debug("Connection authorization failed: "+ae.getMessage(), ae); rpcMetrics.authorizationFailures.inc(); SecureCall failedCall = new SecureCall(AUTHORIZATION_FAILED_CALLID, null, this, - null); + null, 0); failedCall.setResponse(null, Status.FATAL, ae.getClass().getName(), ae.getMessage()); responder.doRespond(failedCall);