[
https://issues.apache.org/jira/browse/SCB-962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16660223#comment-16660223
]
ASF GitHub Bot commented on SCB-962:
------------------------------------
zhfeng commented on a change in pull request #322: [SCB-962] Support
ForwardPolicy to configure the maximum of retries
URL:
https://github.com/apache/incubator-servicecomb-saga/pull/322#discussion_r227268175
##########
File path:
saga-core/src/main/java/org/apache/servicecomb/saga/core/ForwardRecovery.java
##########
@@ -49,6 +49,15 @@ public SagaResponse apply(SagaTask task, SagaRequest
request, SagaResponse paren
ignored);
throw new TransactionFailedException(ignored);
}
+ throw new TransactionAbortedException(
+ String.format(
+ "Too many failures in transaction %s of service %s, abort the
transaction!",
+ request.transaction(),
+ request.serviceName()));
+ }
+
+ private boolean isRetryable(int i, Transaction transaction) {
+ return transaction.retries() == Transaction.INFINITE_RETRY || i <=
transaction.retries();
Review comment:
I think it could be an issue here. if the transaction.retries() is 0, it
just run sout of the loop and has no retry at all. But you mention in the
document
> If this parameter is less than or equal to 0, transaction will retry
infinitely.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> The forwardPolicy of Saga can configure the maximum of retries
> --------------------------------------------------------------
>
> Key: SCB-962
> URL: https://issues.apache.org/jira/browse/SCB-962
> Project: Apache ServiceComb
> Issue Type: Improvement
> Components: Saga
> Affects Versions: saga-0.2.0
> Reporter: Sion Yang
> Assignee: Sion Yang
> Priority: Major
> Fix For: saga-0.3.0
>
> Original Estimate: 168h
> Remaining Estimate: 168h
>
> Currently, forwardPolicy would keep trying transaction part when transaction
> failed, which may cause saga retry transaction infinitely.
> So it's necessary to configure the maximum of transaction retries.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)