Skip to content
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

[Housekeeping] Admin endpoint doesn't bubble up errors #4723

Open
2 tasks done
pvditt opened this issue Jan 13, 2024 · 1 comment
Open
2 tasks done

[Housekeeping] Admin endpoint doesn't bubble up errors #4723

pvditt opened this issue Jan 13, 2024 · 1 comment
Assignees
Labels
backlogged For internal use. Reserved for contributor team workflow. bug Something isn't working exo housekeeping Issues that help maintain flyte and keep it tech-debt free

Comments

@pvditt
Copy link
Contributor

pvditt commented Jan 13, 2024

Describe the issue

The GetExecutionData endpoint in admin does not bubble up errors when fetching inputs/outputs. Instead, the outputs are set to empty causing for confusion. (Unused URL blobs are returned in the response )

What if we do not do this?

Just code cleanliness - potentially some confusion on how errors are getting bubbled up to clients.

Related component(s)

flyteadmin

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@pvditt pvditt added the housekeeping Issues that help maintain flyte and keep it tech-debt free label Jan 13, 2024
@pvditt pvditt self-assigned this Jan 13, 2024
Copy link

dosubot bot commented Jan 13, 2024

🤖

Hello @pvditt! I'm Dosu, an AI bot here to help you with your Flyte issues. While we're waiting for a human maintainer to join us, I'm available to help troubleshoot bugs, answer questions, and guide you through contributing to Flyte. Nice to meet you!

The GetExecutionData function in the ExecutionManager does not bubble up errors when fetching inputs/outputs because it is designed to handle errors internally and return a response regardless of whether the inputs/outputs are successfully fetched or not.

In the provided code, if there is an error while fetching the inputs or outputs, the error is logged and the function continues to the next step. The function does not stop execution or bubble up the error. Instead, it returns a response with the inputs and outputs that were successfully fetched, and any inputs or outputs that could not be fetched are set to nil.

This design choice could be due to a variety of reasons. One possible reason is to ensure that the function always returns a response, even if some data could not be fetched. This can be useful in situations where partial data is better than no data. However, this can also lead to confusion if the user is not aware that some data could not be fetched.

Here is the relevant code:

inputs, inputURLBlob, err := util.GetInputs(ctx, m.urlData, m.config.ApplicationConfiguration().GetRemoteDataConfig(),
	m.storageClient, executionModel.InputsURI.String())
if err != nil {
	return nil, err
}
outputs, outputURLBlob, err := util.GetOutputs(ctx, m.urlData, m.config.ApplicationConfiguration().GetRemoteDataConfig(),
	m.storageClient, util.ToExecutionClosureInterface(execution.Closure))
if err != nil {
	return nil, err
}
response := &admin.WorkflowExecutionGetDataResponse{
	Inputs:      inputURLBlob,
	Outputs:     outputURLBlob,

In this code, if there is an error while fetching the inputs or outputs (util.GetInputs or util.GetOutputs), the error is returned and the function continues to the next step. The Inputs and Outputs in the response are set to the inputURLBlob and outputURLBlob respectively, which could be nil if there was an error while fetching them.

You can find this code in the flyteadmin/pkg/manager/impl/execution_manager.go file.

As for the GetNodeExecutionData function in the ExecutionManager within the flyteadmin component, it is used to retrieve the data associated with a specific node execution. This function takes in a NodeExecutionGetDataRequest which contains the details of the node execution for which the data is to be retrieved. It returns a NodeExecutionGetDataResponse which contains the data associated with the node execution.

In the provided context, the GetNodeExecutionData function is part of a mock NodeExecutionManager and is used for testing purposes. The actual implementation of the function would be set using the SetGetNodeExecutionDataFunc method. If no implementation is set, the function will return nil, nil.

You can find this code in the flyteadmin/pkg/manager/mocks/node_execution.go file.

I hope this clarifies your question. If you have any further questions, feel free to ask.

-Dosu

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlogged For internal use. Reserved for contributor team workflow. bug Something isn't working exo housekeeping Issues that help maintain flyte and keep it tech-debt free
Projects
None yet
Development

No branches or pull requests

2 participants