Skip to content

Commit

Permalink
OOZIE-1653 Support ALL to allowed error code of the user retry (seoeu…
Browse files Browse the repository at this point in the history
…n25 via rkanter)
  • Loading branch information
rkanter committed Sep 5, 2014
1 parent bb9a6da commit 60212d4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ public boolean handleUserRetry(WorkflowActionBean action) throws CommandExceptio
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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/resources/oozie-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1782,14 +1782,16 @@
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>

<property>
<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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,27 @@ public void testRetry() throws Exception {
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));
}


}
1 change: 1 addition & 0 deletions release-log.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 60212d4

Please sign in to comment.