Skip to content
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

source: avoid hang if no session id for oci-layout #3122

Merged
merged 1 commit into from
Sep 20, 2022

Conversation

jedevc
Copy link
Member

@jedevc jedevc commented Sep 20, 2022

Split out timeout fix from: #3118.

In the scenario with no session id, then the oci-layout resolver would still attempt to load a caller with the empty session id. This inevitably failed, and would fallback to any caller, but this would take 5 seconds to fail with the configured timeout.

In a fresh pull of an OCI image context, this could take up to 15 seconds, as 3 separate calls to the relevant functions would be made.

This patch fixes the issue by correctly identifying this case, and directly falling through to any caller. Additionally, if a session id is present, it will always be loaded with no fallback available. To do this consistently, the helper methods are refactored into a more consistent withCaller function.

CC @deitch

In the scenario with no session id, then the oci-layout resolver would
still attempt to load a caller with the empty session id. This
inevitably failed, and would fallback to any caller, but this would take
5 seconds to fail with the configured timeout.

In a fresh pull of an OCI image context, this could take up to 15
seconds, as 3 separate calls to the relevant functions would be made.

This patch fixes the issue by correctly identifying this case, and
directly falling through to any caller. Additionally, if a session id is
present, it will always be loaded with no fallback available. To do
this consistently, the helper methods are refactored into a more
consistent withCaller function.

Signed-off-by: Justin Chadwell <me@jedevc.com>
@jedevc jedevc requested a review from tonistiigi September 20, 2022 09:33
Copy link
Contributor

@deitch deitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finding this issue and fixing it @jedevc

@tonistiigi tonistiigi merged commit 20df1a8 into moby:master Sep 20, 2022
@jedevc jedevc deleted the oci-layout-timeout branch September 21, 2022 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants