-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
don't cast Value when pipe is errored #2385
Conversation
I also tried to write a test for this, but it's not easy to mess up with graph during the build at the right moment. |
We shouldn't return out without processing through all updates. It might be ok to skip the commands inside the current if block. But returning |
fee6d50
to
c669d3b
Compare
Isn't the loop to process updates outside of the function we're changing here ? In case of an error we're returning at the end of the if block anyway, and everything in between requires the cast to succeed.
Removed! |
Ok, I thought this code was iterating over all updates. Still, this error condition is complicated (with the cancel check etc) so I'd rather check the cast failure.
Did you try returning the req.edgeState? It looks cleaner than this nil (unless we want to refactor all of these updates to handle nils). |
c669d3b
to
618809a
Compare
I can return the buildkit/solver/internal/pipe/pipe.go Lines 83 to 87 in 4e69662
|
618809a
to
27a6cb3
Compare
Hmm. Then why wouldn't it panic in this cast for any regular error from a dependant edge? |
Ah, ok. The value is thrown away in func error, but not in |
Signed-off-by: Maxime Lagresle <maxime@angel.co>
27a6cb3
to
e76cfcf
Compare
Follow up of #2382
I couldn't find an easy way to get an
&edgeState{}
as Value of the errored pipe. It seems the simplest solution is to not cast the Value in such a situation. Eventually we could also check if the Value can be cast, and return if it's not the case, but I'm not sure if it brings anything. Thoughts @tonistiigi ?Having
target==nil
would end up with the following error./cc @jamesalucas