-
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
Inconsistent Marshalling Order in client/llb
#4695
Comments
This is not intended and can be directly fixed. Iiuc this does not affect cache as the indexing of inputs is consistent. But it may have an impact on parallel requests where some nodes need to do extra work to compute cache keys instead of just being deduplicated in LLB graph. |
Got it, thanks for the prompt response here! Just to clarify, were you planning on fixing this? I do have a fix I was looking at and can open a PR |
If you have a PR already, then open it. If not, then I can carry this as well. |
I have opened #4706. I'd like to see if it passes CI first before full review, as I've had some trouble running the full test suite locally |
Actually, I think I looked at it wrong. The code you have pointed out only seems to change the marshaling order, so the order of elements in the definition array. The actual input order for each vertex, and therefore the content addressable digest for each operation seems to have correct guaranteed ordering already. We can still make it consistent, but it should not have any effect for the builds at all. On the daemon side these are all read into a map and keyed by their digest, so individual ordering has no impact. |
I believe this can be closed now due to #311. |
We are building a frontend for buildkit, and in testing have noticed some inconsistent behavior with the buildkit client LLB marshaller. Specifically, when multiple source nodes for an
ExecOp
are present, the sources are not marshaled in a consistent order. I've tracked the issue to the following places in theInputs
implementations inclient/llb/exec.go
, and also inclient/llb/fileop.go
. It appears that iteration over map keys is used to return the inputs toExecOp
andFileOp
while the marshaller is traversing the state graph, which means the traversal order will be inconsistent and the ops preceding anyExecOp
andFileOp
will be marshaled in a possibly random order.I just wanted to ask if:
I've included the following program which should reproduce the behavior.
The text was updated successfully, but these errors were encountered: