expose IsOperationAccessIsDenied, IsOperationInvalidState error checks#457
expose IsOperationAccessIsDenied, IsOperationInvalidState error checks#457andrey-ko wants to merge 1 commit intomicrosoft:masterfrom
Conversation
on RS1, RS2 builds call to GetContainers may fail with 'access denied' or 'invalid state' errors. You may want to have retry loop to resolve this issue. But there should be a way to check if returned error is one of these types. This commit exposes IsOperationAccessIsDenied and IsOperationInvalidState for these cases. Signed-off-by: Andrey Kolomentsev <andrey.kolomentsev@gmail.com>
|
@jhowardmsft - This is not breaking to V1. I am ok with forwarding these interfaces you? |
|
I'm confused - did we break the previous error detection somehow? |
|
@jhowardmsft yes it was broken. Before GetContainers was returning syscall.Errno. But after this commit e70197a#diff-ece1473ec5e6e5832bc471a16557a457L157 it was wrapped with HcsError type. And after it this retry loop https://github.com/moby/moby/blob/5ec31380a5d3ea92fc68e53cd1fc96f11ac02e6e/daemon/graphdriver/windows/windows.go#L276 stopped working More specifically condition err == hcsshim.ErrVmcomputeOperationAccessIsDenied is always false now because err is of hcs.HcsError type now, not syscall.Errno as it was before |
|
Oh man. That's a super subtle breaking change. There are more in there too we need to examine or undo. The error model looks to be changed in four places in that commit. @jstarks - Do you want to weigh in on an undo vs checking callers for error pattern changes here? |
|
Perhaps we should have the root package pull the syscall.Errno back out for compatibility, so that code using the internal packages can continue to get the rich error information. |
|
@jhowardmsft - Assigning to you. |
|
Wondering if hcsshim should define some standard interfaces (see The current |
|
@thaJeztah - I had the same thought. Unfortunately however these are breaking changes and need to be undone. But I agree that long term exposing the syscall error's with a |
|
@ddebroy PTAL; looks like this needs a carry |
on RS1, RS2 builds call to GetContainers may fail with 'access denied' or
'invalid state' errors. You may want to have retry loop to resolve this
issue. But there should be a way to check if returned error is one of these
types. This commit exposes IsOperationAccessIsDenied and IsOperationInvalidState
for these cases.
one use case may be found here: https://github.com/moby/moby/blob/5ec31380a5d3ea92fc68e53cd1fc96f11ac02e6e/daemon/graphdriver/windows/windows.go#L276