-
Notifications
You must be signed in to change notification settings - Fork 10
Fix issue #188 #189
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
Fix issue #188 #189
Conversation
| switch (interruptedReplicate.getRecoveryAction()) { | ||
| case WAIT: | ||
| subscriptionService.subscribeToTopic(chainTaskId); | ||
| resultService.saveResultInfo(chainTaskId, replicateModel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering, couldn't we resultService.saveResultInfo(chainTaskId, replicateModel); once for all at the beginning of the recoverReplicate(..) method (so we don't miss any case)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we don't need it for all cases.
| case COMPLETE: | ||
| taskExecutorService.completeTask(chainTaskId); | ||
| break; | ||
| if (!isResultAvailable && recoveryAction != RecoveryAction.CONTRIBUTE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about something like:
isResultRequired = (recoveryAction == WAIT ||recoveryAction == CONTRIBUTE || recoveryAction == REVEAL recoveryAction == UPLOAD_RESULT);
if(!isResultAvailable && isResultRequired){
log.error(..)
continue;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's clearer. But when recoveryAction == CONTRIBUTE the result is not necessarily needed because we can re-do the computation.
So I'd say:
isResultRequired = Arrays.asList(WAIT, REVEAL, UPLOAD_RESULT).contains(recoveryAction);
Ugo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems all good for me Zied! Thank you
No description provided.