You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by sp...@apache.org on 2021/06/23 03:25:44 UTC
[ranger] branch master updated: Fixed a minor issue where retry
flag is not set properly for unix and file sync sources
This is an automated email from the ASF dual-hosted git repository.
spolavarapu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git
The following commit(s) were added to refs/heads/master by this push:
new e56eac1 Fixed a minor issue where retry flag is not set properly for unix and file sync sources
e56eac1 is described below
commit e56eac1802ae4a0f0f17d2aa0d15036537e5a526
Author: Sailaja Polavarapu <sp...@cloudera.com>
AuthorDate: Tue Jun 22 18:42:55 2021 -0700
Fixed a minor issue where retry flag is not set properly for unix and file sync sources
---
.../apache/ranger/unixusersync/process/FileSourceUserGroupBuilder.java | 2 +-
.../org/apache/ranger/unixusersync/process/UnixUserGroupBuilder.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ugsync/src/main/java/org/apache/ranger/unixusersync/process/FileSourceUserGroupBuilder.java b/ugsync/src/main/java/org/apache/ranger/unixusersync/process/FileSourceUserGroupBuilder.java
index 0a4de66..814f867 100644
--- a/ugsync/src/main/java/org/apache/ranger/unixusersync/process/FileSourceUserGroupBuilder.java
+++ b/ugsync/src/main/java/org/apache/ranger/unixusersync/process/FileSourceUserGroupBuilder.java
@@ -114,6 +114,7 @@ public class FileSourceUserGroupBuilder extends AbstractUserGroupSource impleme
// we want to retry the sync process even if there are no changes to the sync files
if (!isUpdateSinkSucc) {
LOG.info("Previous updateSink failed and hence retry!!");
+ isUpdateSinkSucc = true;
return true;
}
try {
@@ -141,7 +142,6 @@ public class FileSourceUserGroupBuilder extends AbstractUserGroupSource impleme
@Override
public void updateSink(UserGroupSink sink) throws Throwable {
- isUpdateSinkSucc = true;
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date lastModifiedTime = new Date(usergroupFileModified);
Date syncTime = new Date(System.currentTimeMillis());
diff --git a/ugsync/src/main/java/org/apache/ranger/unixusersync/process/UnixUserGroupBuilder.java b/ugsync/src/main/java/org/apache/ranger/unixusersync/process/UnixUserGroupBuilder.java
index 4d12def..4686614 100644
--- a/ugsync/src/main/java/org/apache/ranger/unixusersync/process/UnixUserGroupBuilder.java
+++ b/ugsync/src/main/java/org/apache/ranger/unixusersync/process/UnixUserGroupBuilder.java
@@ -156,6 +156,7 @@ public class UnixUserGroupBuilder implements UserGroupSource {
// we want to retry the sync process even if there are no changes to the sync files
if (!isUpdateSinkSucc) {
LOG.info("Previous updateSink failed and hence retry!!");
+ isUpdateSinkSucc = true;
return true;
}
try {
@@ -198,7 +199,6 @@ public class UnixUserGroupBuilder implements UserGroupSource {
Date syncTime = new Date(System.currentTimeMillis());
unixSyncSourceInfo.setLastModified(formatter.format(lastModifiedTime));
unixSyncSourceInfo.setSyncTime(formatter.format(syncTime));
- isUpdateSinkSucc = true;
if (isChanged() || isStartupFlag) {
buildUserGroupInfo();
if (LOG.isDebugEnabled()) {