You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by me...@apache.org on 2021/02/26 13:06:31 UTC
[hbase] branch master updated: HBASE-25586 Fix HBASE-22492 on
branch-2 (SASL GapToken) (#2961)
This is an automated email from the ASF dual-hosted git repository.
meszibalu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new a984358 HBASE-25586 Fix HBASE-22492 on branch-2 (SASL GapToken) (#2961)
a984358 is described below
commit a984358d9fdd2c6e48787ce40b3f3c6b0d352695
Author: Balazs Meszaros <me...@apache.org>
AuthorDate: Fri Feb 26 14:05:59 2021 +0100
HBASE-25586 Fix HBASE-22492 on branch-2 (SASL GapToken) (#2961)
ServerCall.java: calling wrapWithSasl() was moved to getResponse(), so
the SASL wrapping is delayed until the reply is sent back to the client.
Signed-off-by: Peter Somogyi <ps...@apache.org>
---
.../java/org/apache/hadoop/hbase/ipc/ServerCall.java | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ServerCall.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ServerCall.java
index a5c8a39..b53c770 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ServerCall.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ServerCall.java
@@ -281,9 +281,6 @@ public abstract class ServerCall<T extends ServerRpcConnection> implements RpcCa
}
}
bc = new BufferChain(responseBufs);
- if (connection.useWrap) {
- bc = wrapWithSasl(bc);
- }
} catch (IOException e) {
RpcServer.LOG.warn("Exception while creating response " + e);
}
@@ -547,6 +544,20 @@ public abstract class ServerCall<T extends ServerRpcConnection> implements RpcCa
@Override
public synchronized BufferChain getResponse() {
- return response;
+ if (connection.useWrap) {
+ /*
+ * wrapping result with SASL as the last step just before sending it out, so
+ * every message must have the right increasing sequence number
+ */
+ try {
+ return wrapWithSasl(response);
+ } catch (IOException e) {
+ /* it is exactly the same what setResponse() does */
+ RpcServer.LOG.warn("Exception while creating response " + e);
+ return null;
+ }
+ } else {
+ return response;
+ }
}
}