CDH-53385: SENTRY-1640: Handle the response error status when 
sentry_sync_notifications fails.

Change-Id: I62b7db29230ea65c58c9bf52c80c0850b2479b2b
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/22283
Reviewed-by: Sergio Pena <[email protected]>
Tested-by: Jenkins User
Reviewed-by: Alexander Kolbasov <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/afc1d825
Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/afc1d825
Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/afc1d825

Branch: refs/for/cdh5-1.5.1_ha
Commit: afc1d825a1a3cc23560f4d79c4245fcae3fd8ef6
Parents: c9a703c
Author: Sergio Pena <[email protected]>
Authored: Wed May 3 15:31:53 2017 -0500
Committer: Alexander Kolbasov <[email protected]>
Committed: Fri May 5 13:21:43 2017 -0700

----------------------------------------------------------------------
 .../db/service/thrift/SentryPolicyServiceClientDefaultImpl.java     | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/afc1d825/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClientDefaultImpl.java
----------------------------------------------------------------------
diff --git 
a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClientDefaultImpl.java
 
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClientDefaultImpl.java
index a4c2c8e..a82dba6 100644
--- 
a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClientDefaultImpl.java
+++ 
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClientDefaultImpl.java
@@ -842,6 +842,7 @@ public class SentryPolicyServiceClientDefaultImpl 
implements SentryPolicyService
 
     try {
       TSentrySyncIDResponse response = 
client.sentry_sync_notifications(request);
+      Status.throwIfNotOk(response.getStatus());
       return response.getId();
     } catch (TException e) {
       throw new SentryUserException(THRIFT_EXCEPTION_MESSAGE, e);

Reply via email to