KomachiSion 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_r227279175
##########
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:
When Transaction is generated from Json and retries is 0, retires will be
set to Transaction.INFINITE_RETRY.
The correlation can be viewed from JacksonSQLTransaction or
JacksonRestTransaction.
Of course, the problem you said does exist, I fix it right now.
----------------------------------------------------------------
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]
With regards,
Apache Git Services