OOZIE-1653 Support ALL to allowed error code of the user retry (seoeun25 via rkanter)
Project: http://git-wip-us.apache.org/repos/asf/oozie/repo Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/60212d4d Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/60212d4d Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/60212d4d Branch: refs/remotes/trunk Commit: 60212d4d2022c11cd09eaa26b5cc57bb334c694e Parents: bb9a6da Author: Robert Kanter <[email protected]> Authored: Fri Sep 5 13:05:03 2014 -0700 Committer: Robert Kanter <[email protected]> Committed: Fri Sep 5 13:05:03 2014 -0700 ---------------------------------------------------------------------- .../apache/oozie/command/wf/ActionXCommand.java | 3 ++- .../oozie/service/LiteWorkflowStoreService.java | 2 ++ core/src/main/resources/oozie-default.xml | 4 +++- .../service/TestLiteWorkflowStoreService.java | 22 ++++++++++++++++++++ release-log.txt | 1 + 5 files changed, 30 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oozie/blob/60212d4d/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java b/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java index 405d712..98fddfd 100644 --- a/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java @@ -216,7 +216,8 @@ public abstract class ActionXCommand<T> extends WorkflowXCommand<Void> { String errorCode = action.getErrorCode(); Set<String> allowedRetryCode = LiteWorkflowStoreService.getUserRetryErrorCode(); - if (allowedRetryCode.contains(errorCode) && action.getUserRetryCount() < action.getUserRetryMax()) { + if ((allowedRetryCode.contains(LiteWorkflowStoreService.USER_ERROR_CODE_ALL) || allowedRetryCode.contains(errorCode)) + && action.getUserRetryCount() < action.getUserRetryMax()) { LOG.info("Preparing retry this action [{0}], errorCode [{1}], userRetryCount [{2}], " + "userRetryMax [{3}], userRetryInterval [{4}]", action.getId(), errorCode, action .getUserRetryCount(), action.getUserRetryMax(), action.getUserRetryInterval()); http://git-wip-us.apache.org/repos/asf/oozie/blob/60212d4d/core/src/main/java/org/apache/oozie/service/LiteWorkflowStoreService.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/service/LiteWorkflowStoreService.java b/core/src/main/java/org/apache/oozie/service/LiteWorkflowStoreService.java index bab32c6..8a7017e 100644 --- a/core/src/main/java/org/apache/oozie/service/LiteWorkflowStoreService.java +++ b/core/src/main/java/org/apache/oozie/service/LiteWorkflowStoreService.java @@ -67,6 +67,8 @@ public abstract class LiteWorkflowStoreService extends WorkflowStoreService { public static final String NODE_DEF_VERSION_1 = "_oozie_inst_v_1"; public static final String CONF_NODE_DEF_VERSION = CONF_PREFIX + "node.def.version"; + public static final String USER_ERROR_CODE_ALL = "ALL"; + /** * Delegation method used by the Action and Decision {@link NodeHandler} on start. <p/> This method provides the * necessary information to create ActionExecutors. http://git-wip-us.apache.org/repos/asf/oozie/blob/60212d4d/core/src/main/resources/oozie-default.xml ---------------------------------------------------------------------- diff --git a/core/src/main/resources/oozie-default.xml b/core/src/main/resources/oozie-default.xml index 3a957d0..a5ccd3c 100644 --- a/core/src/main/resources/oozie-default.xml +++ b/core/src/main/resources/oozie-default.xml @@ -1782,6 +1782,7 @@ JA017 is job not exists error in action executor. JA008 is FileNotFoundException in action executor. JA009 is IOException in action executor. + ALL is the any kind of error in action executor. </description> </property> @@ -1789,7 +1790,8 @@ <name>oozie.service.LiteWorkflowStoreService.user.retry.error.code.ext</name> <value> </value> <description> - Automatic retry interval for workflow action is handled for these specified extra error code. + Automatic retry interval for workflow action is handled for these specified extra error code: + ALL is the any kind of error in action executor. </description> </property> http://git-wip-us.apache.org/repos/asf/oozie/blob/60212d4d/core/src/test/java/org/apache/oozie/service/TestLiteWorkflowStoreService.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/oozie/service/TestLiteWorkflowStoreService.java b/core/src/test/java/org/apache/oozie/service/TestLiteWorkflowStoreService.java index c0a8bbe..1eda445 100644 --- a/core/src/test/java/org/apache/oozie/service/TestLiteWorkflowStoreService.java +++ b/core/src/test/java/org/apache/oozie/service/TestLiteWorkflowStoreService.java @@ -60,5 +60,27 @@ public class TestLiteWorkflowStoreService extends XTestCase { assertTrue(allowedRetryCodes.contains(ForTestingActionExecutor.TEST_ERROR)); } + public void testRetryAllErrorCode() throws Exception { + String errorCodeWithWhitespaces = "\n\t\t" + ForTestingActionExecutor.TEST_ERROR + "," + + LiteWorkflowStoreService.USER_ERROR_CODE_ALL + "\n "; + Configuration testConf = Services.get().get(ConfigurationService.class).getConf(); + // Setting configuration parameter for retry.error.code + testConf.set(LiteWorkflowStoreService.CONF_USER_RETRY_ERROR_CODE, errorCodeWithWhitespaces); + Set<String> allowedRetryCodes = LiteWorkflowStoreService.getUserRetryErrorCode(); + assertTrue(allowedRetryCodes.contains(ForTestingActionExecutor.TEST_ERROR)); + assertTrue(allowedRetryCodes.contains(LiteWorkflowStoreService.USER_ERROR_CODE_ALL)); + + // Setting configuration parameter for retry.error.code and retry.error.code.ext + testConf.set(LiteWorkflowStoreService.CONF_USER_RETRY_ERROR_CODE_EXT, "ALL"); + allowedRetryCodes = LiteWorkflowStoreService.getUserRetryErrorCode(); + assertTrue(allowedRetryCodes.contains(ForTestingActionExecutor.TEST_ERROR)); + assertTrue(allowedRetryCodes.contains(LiteWorkflowStoreService.USER_ERROR_CODE_ALL)); + + testConf.set(LiteWorkflowStoreService.CONF_USER_RETRY_ERROR_CODE, " "); + testConf.set(LiteWorkflowStoreService.CONF_USER_RETRY_ERROR_CODE_EXT, "ALL"); + allowedRetryCodes = LiteWorkflowStoreService.getUserRetryErrorCode(); + assertTrue(allowedRetryCodes.contains(LiteWorkflowStoreService.USER_ERROR_CODE_ALL)); + } + } http://git-wip-us.apache.org/repos/asf/oozie/blob/60212d4d/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index bcd098c..0435249 100644 --- a/release-log.txt +++ b/release-log.txt @@ -1,5 +1,6 @@ -- Oozie 4.2.0 release (trunk - unreleased) +OOZIE-1653 Support ALL to allowed error code of the user retry (seoeun25 via rkanter) OOZIE-1923 ZKLocksService locks are not re-entrant like MemoryLocks (puru) OOZIE-1843 Bulk update for coord last modified time for CoordMaterializeTriggerService (puru) OOZIE-1941 Bundle coordinator name can't be parameterized (puru)
