Skip to content

Commit

Permalink
check deck uri exists before checking for datastore existance (flyteo…
Browse files Browse the repository at this point in the history
…rg#506)

Signed-off-by: Dan Rammer <[email protected]>

Signed-off-by: Dan Rammer <[email protected]>
  • Loading branch information
hamersaw authored Nov 30, 2022
1 parent 19acf71 commit ca7c744
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions flytepropeller/pkg/controller/nodes/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,16 @@ func (c *nodeExecutor) attemptRecovery(ctx context.Context, nCtx handler.NodeExe
}

deckFile := storage.DataReference(recovered.Closure.GetDeckUri())
metadata, err := nCtx.DataStore().Head(ctx, deckFile)
if err != nil {
logger.Errorf(ctx, "Failed to check the existence of deck file. Error: %v", err)
return handler.PhaseInfoUndefined, errors.Wrapf(errors.CausedByError, nCtx.NodeID(), err, "Failed to check the existence of deck file.")
}
if len(deckFile) > 0 {
metadata, err := nCtx.DataStore().Head(ctx, deckFile)
if err != nil {
logger.Errorf(ctx, "Failed to check the existence of deck file. Error: %v", err)
return handler.PhaseInfoUndefined, errors.Wrapf(errors.CausedByError, nCtx.NodeID(), err, "Failed to check the existence of deck file.")
}

if metadata.Exists() {
oi.DeckURI = &deckFile
if metadata.Exists() {
oi.DeckURI = &deckFile
}
}

if err := c.store.WriteProtobuf(ctx, outputFile, so, outputs); err != nil {
Expand Down

0 comments on commit ca7c744

Please sign in to comment.