-
Notifications
You must be signed in to change notification settings - Fork 356
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
fix(api): handle delete experiment failures correctly #8459
Conversation
✅ Deploy Preview for determined-ui canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -48,7 +48,9 @@ var ( | |||
// called twice for the same resource, etc). | |||
func MockRM() *mocks.ResourceManager { | |||
var mockRM mocks.ResourceManager | |||
mockRM.On("DeleteJob", mock.Anything).Return(sproto.EmptyDeleteJobResponse(), nil) | |||
mockRM.On("DeleteJob", mock.Anything).Return(func(sproto.DeleteJob) sproto.DeleteJobResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: why need a function func(sproto.DeleteJob)
instead of returning sproto.EmptyDeleteJobResponse()
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because the response gets reused for everything that calls it, and so we don't get a new channel and 2/3 of the jobs block indefinitely.
Description
DeleteExperiments was misinterpreting the response from a function it called, resulting in non-sense behavior. I improved the API of the function and fixed the calling code. I also fixed some cases where we were erroneously logging errors on success cases.
Test Plan
Commentary (optional)
Checklist
docs/release-notes/
.See Release Note for details.
Ticket
DET-9978