Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle the case where polling for decision tasks fails due to the fac… #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflow;
import com.amazonaws.services.simpleworkflow.flow.common.WorkflowExecutionUtils;
import com.amazonaws.services.simpleworkflow.model.DecisionTask;
Expand Down Expand Up @@ -168,7 +169,16 @@ private DecisionTask poll(String nextResultToken) {
if (log.isDebugEnabled()) {
log.debug("poll request begin: " + pollRequest);
}
DecisionTask result = service.pollForDecisionTask(pollRequest);
DecisionTask result;
try {
result = service.pollForDecisionTask(pollRequest);
} catch (AmazonServiceException e) {
if (log.isDebugEnabled()) {
log.debug("poll request failed due to " + e.getMessage() + " retrying without a next page token");
}
pollRequest.setNextPageToken(null);
result = service.pollForDecisionTask(pollRequest);
}
if (log.isDebugEnabled()) {
log.debug("poll request returned decision task: workflowType=" + result.getWorkflowType() + ", workflowExecution="
+ result.getWorkflowExecution() + ", startedEventId=" + result.getStartedEventId() + ", previousStartedEventId=" + result.getPreviousStartedEventId());
Expand Down