Merged
Conversation
hosts mutex is called on initialization, meaning `GetResolver` might block if it is in the middle of auth exchange. This is currently bad in the case where Job initialization needs to register a name before timeout is reached. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Authorizer stores the current session.Group so if it is overwritten for another resolver it means that session might have been dropped and authentication will fail. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
maxlaverse
reviewed
Sep 20, 2021
|
|
||
| func (jl *Solver) Get(id string) (*Job, error) { | ||
| ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) | ||
| ctx, cancel := context.WithTimeout(context.Background(), 6*time.Second) |
Contributor
There was a problem hiding this comment.
@tonistiigi this is to be above the 5 seconds timeout of the sessionManager.Any() ?
Member
Author
There was a problem hiding this comment.
These shouldn't be related. One should never wait for another.
AkihiroSuda
approved these changes
Sep 21, 2021
Merged
jmacelroy
pushed a commit
to okteto/buildkit
that referenced
this pull request
Oct 19, 2021
closes moby#2367 closes moby#2088 hosts mutex is called on initialization, meaning GetResolver might block if it is in the middle of auth exchange. This is currently bad in the case where the Job initialization needs to register a name before timeout is reached. Authorizer stores the current session.Group so if it is overwritten for another resolver it means that session might have been dropped and authentication will fail. I haven't been able to reproduce this issue so not 100% it fixes the case but even if it is a different race it looks incorrect anyway. For the Job registration, we might want to do some follow-up change that avoids running things before job ID is registered.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #2367
closes #2088
hosts mutex is called on initialization, meaning
GetResolvermightblock if it is in the middle of auth exchange. This is currently bad
in the case where the Job initialization needs to register a name before
timeout is reached.
Authorizer stores the current
session.Groupso if it isoverwritten for another resolver it means that session might
have been dropped and authentication will fail. I haven't been able
to reproduce this issue so not 100% it fixes the case but even if it is
a different race it looks incorrect anyway.
For the Job registration, we might want to do some follow-up change
that avoids running things before job ID is registered.
@maxlaverse