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

model.Execution and models.Execution have different definitions of terminal state #4146

Open
frrist opened this issue Jun 26, 2024 · 2 comments · May be fixed by #4147
Open

model.Execution and models.Execution have different definitions of terminal state #4146

frrist opened this issue Jun 26, 2024 · 2 comments · May be fixed by #4147
Assignees
Labels
request/new Request: Indicates a new request that has been submitted and awaits initial triage type/bug Type: Something is not working as expected

Comments

@frrist
Copy link
Member

frrist commented Jun 26, 2024

The model Execution considers the following states to be terminal:

  • ExecutionStateAskForBidRejected
  • ExecutionStateBidRejected
  • ExecutionStateCancelled
  • ExecutionStateFailed
  • ExecutionStateCompleted

func (s ExecutionStateType) IsTerminal() bool {
return s.IsDiscarded() || s == ExecutionStateCompleted
}

func (s ExecutionStateType) IsDiscarded() bool {
return s == ExecutionStateAskForBidRejected || s == ExecutionStateBidRejected ||
s == ExecutionStateCancelled || s == ExecutionStateFailed
}

The model Execution considers the following states to be terminal:

  • ExecutionStateBidRejected
  • ExecutionStateCompleted
  • ExecutionStateFailed
  • ExecutionStateCancelled

func (s ExecutionStateType) IsTermainl() bool {
return s == ExecutionStateBidRejected ||
s == ExecutionStateCompleted ||
s == ExecutionStateFailed ||
s == ExecutionStateCancelled
}

The different being ExecutionStateAskForBidRejected. @wdbaruni is this a bug?

@frrist frrist added type/bug Type: Something is not working as expected request/new Request: Indicates a new request that has been submitted and awaits initial triage labels Jun 26, 2024
@frrist frrist self-assigned this Jun 26, 2024
@wdbaruni
Copy link
Member

Looks like a bug. Actually we've stopped using ExecutionStateType.IsTerminal() in favour of Execution.IsTerminalState(), but it is still being used in one place when printing cli progress

@frrist
Copy link
Member Author

frrist commented Jun 26, 2024

Got it, I have fixed this here: https://github.com/bacalhau-project/bacalhau/pull/4147/files#diff-b63449354c9d58981e007903938dbaac6119844a3eaec272e500e838cb28a0b0R50. Will close this issue out when #4147 merges as I noticed this bug when updating some of our tests to the new models.

@frrist frrist linked a pull request Jun 27, 2024 that will close this issue
@frrist frrist linked a pull request Jun 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request/new Request: Indicates a new request that has been submitted and awaits initial triage type/bug Type: Something is not working as expected
Projects
Status: In Review
Development

Successfully merging a pull request may close this issue.

2 participants