Skip to content

Commit

Permalink
Fix Workflow Build Failure
Browse files Browse the repository at this point in the history
  • Loading branch information
dhanainme authored and lxning committed Mar 31, 2021
1 parent 6ac0587 commit cc46f9d
Show file tree
Hide file tree
Showing 30 changed files with 22 additions and 10,204 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ dist/
.coverage
.github/actions/
.github/.DS_Store
.DS_Store
.DS_Store
frontend/server/src/main/java/org/pytorch/serve/grpc/
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.*;

import org.pytorch.serve.archive.model.ModelNotFoundException;
import org.pytorch.serve.archive.model.ModelVersionNotFoundException;
import org.pytorch.serve.http.InternalServerException;
Expand Down Expand Up @@ -72,8 +71,9 @@ public ArrayList<NodeOutput> execute(RequestInput input, ArrayList<String> topoS

try {
Future<NodeOutput> op = executorCompletionService.take();
if(op == null){
throw new ExecutionException(new RuntimeException("WorkflowNode result empty"));
if (op == null) {
throw new ExecutionException(
new RuntimeException("WorkflowNode result empty"));
} else {
outputs.add(op.get());
}
Expand Down Expand Up @@ -135,7 +135,8 @@ public ArrayList<NodeOutput> execute(RequestInput input, ArrayList<String> topoS
return leafOutputs;
}

private NodeOutput invokeModel(String nodeName, WorkflowModel workflowModel, RequestInput input, int retryAttempt)
private NodeOutput invokeModel(
String nodeName, WorkflowModel workflowModel, RequestInput input, int retryAttempt)
throws ModelNotFoundException, ModelVersionNotFoundException, ExecutionException,
InterruptedException {
try {
Expand All @@ -148,12 +149,18 @@ private NodeOutput invokeModel(String nodeName, WorkflowModel workflowModel, Req
return new NodeOutput(nodeName, resp);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
logger.error(e.getMessage());
if(retryAttempt < workflowModel.getRetryAttempts()){
logger.error(String.format("Timed out while executing %s for attempt %d", nodeName, retryAttempt));
if (retryAttempt < workflowModel.getRetryAttempts()) {
logger.error(
String.format(
"Timed out while executing %s for attempt %d",
nodeName, retryAttempt));
return invokeModel(nodeName, workflowModel, input, ++retryAttempt);
} else {
logger.error(nodeName + " : " + e.getMessage());
throw new InternalServerException(String.format("Failed to execute workflow Node after %d attempts : Error executing %s", retryAttempt, nodeName)); // NOPMD
throw new InternalServerException(
String.format(
"Failed to execute workflow Node after %d attempts : Error executing %s",
retryAttempt, nodeName)); // NOPMD
}
} catch (ModelNotFoundException e) {
logger.error("Model not found.");
Expand Down

This file was deleted.

Loading

0 comments on commit cc46f9d

Please sign in to comment.