Skip to content

Commit

Permalink
comment RemoveNonexistentDeckURI
Browse files Browse the repository at this point in the history
Signed-off-by: Future-Outlier <[email protected]>
  • Loading branch information
Future-Outlier committed Nov 26, 2024
1 parent c4b85c6 commit 6aecdcd
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions flytepropeller/pkg/controller/nodes/task/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,26 +190,26 @@ func (p *pluginRequestedTransition) AddDeckURI(ctx context.Context, tCtx *taskEx
p.execInfo.OutputInfo.DeckURI = deckURI
}

// RemoveNonexistentDeckURI removes the deck URI from the plugin execution info if the URI does not exist in remote storage.
func (p *pluginRequestedTransition) RemoveNonexistentDeckURI(ctx context.Context, tCtx *taskExecutionContext) error {
reader := tCtx.ow.GetReader()
if reader == nil && p.execInfo.OutputInfo != nil {
p.execInfo.OutputInfo.DeckURI = nil
return nil
}

exists, err := reader.DeckExists(ctx)
if err != nil {
logger.Errorf(ctx, "Failed to check deck file existence. Error: %v", err)
return regErrors.Wrapf(err, "failed to check existence of deck file")
}

if !exists && p.execInfo.OutputInfo != nil {
p.execInfo.OutputInfo.DeckURI = nil
}

return nil
}
//// RemoveNonexistentDeckURI removes the deck URI from the plugin execution info if the URI does not exist in remote storage.
//func (p *pluginRequestedTransition) RemoveNonexistentDeckURI(ctx context.Context, tCtx *taskExecutionContext) error {
// reader := tCtx.ow.GetReader()
// if reader == nil && p.execInfo.OutputInfo != nil {
// p.execInfo.OutputInfo.DeckURI = nil
// return nil
// }
//
// exists, err := reader.DeckExists(ctx)
// if err != nil {
// logger.Errorf(ctx, "Failed to check deck file existence. Error: %v", err)
// return regErrors.Wrapf(err, "failed to check existence of deck file")
// }
//
// if !exists && p.execInfo.OutputInfo != nil {
// p.execInfo.OutputInfo.DeckURI = nil
// }
//
// return nil
//}

// The plugin interface available especially for testing.
type PluginRegistryIface interface {
Expand Down Expand Up @@ -509,11 +509,11 @@ func (t Handler) invokePlugin(ctx context.Context, p pluginCore.Plugin, tCtx *ta

switch pluginTrns.pInfo.Phase() {
case pluginCore.PhaseSuccess:
// This is to prevent the console from potentially checking the deck URI that does not exist if in final phase(PhaseSuccess).
err = pluginTrns.RemoveNonexistentDeckURI(ctx, tCtx)
if err != nil {
return pluginTrns, err
}
//// This is to prevent the console from potentially checking the deck URI that does not exist if in final phase(PhaseSuccess).
//err = pluginTrns.RemoveNonexistentDeckURI(ctx, tCtx)
//if err != nil {
// return pluginTrns, err
//}

// -------------------------------------
// TODO: @kumare create Issue# Remove the code after we use closures to handle dynamic nodes
Expand Down Expand Up @@ -561,11 +561,11 @@ func (t Handler) invokePlugin(ctx context.Context, p pluginCore.Plugin, tCtx *ta
case pluginCore.PhaseRetryableFailure:
fallthrough
case pluginCore.PhasePermanentFailure:
// This is to prevent the console from potentially checking the deck URI that does not exist if in final phase(PhaseFailure).
err = pluginTrns.RemoveNonexistentDeckURI(ctx, tCtx)
if err != nil {
return pluginTrns, err
}
//// This is to prevent the console from potentially checking the deck URI that does not exist if in final phase(PhaseFailure).
//err = pluginTrns.RemoveNonexistentDeckURI(ctx, tCtx)
//if err != nil {
// return pluginTrns, err
//}
pluginTrns.ObservedFailure(
&event.TaskNodeMetadata{
CheckpointUri: tCtx.ow.GetCheckpointPrefix().String(),
Expand Down

0 comments on commit 6aecdcd

Please sign in to comment.