Skip to content

Fix timeout created more than once#900

Merged
matheuscscp merged 1 commit into
mainfrom
fix-timeout
Jun 18, 2026
Merged

Fix timeout created more than once#900
matheuscscp merged 1 commit into
mainfrom
fix-timeout

Conversation

@matheuscscp

@matheuscscp matheuscscp commented Jun 18, 2026

Copy link
Copy Markdown
Member

After pulling fluxcd/pkg#1244 in, this bug in the timeout has surfaced. We were creating two separate contexts with the .spec.timeout, which has two problems:

  • The first context, for setting up the auth options, gets canceled before the creds are fetched. Since the ctx in auth/utils.GetArtifactRegistryCredentials is now wrapped in a closure that is called lazily, this cancellation bubbles up when the OCI client tries to Authorize. (Authorize does not receive a ctx, which is very unfortunate from go-containerregistry)
  • The effective timeout is not the one promised by the .spec.timeout API field, but up to almost twice that value.

Now the timeout is applied to both auth setup + registry calls, as it should.

Note: This bug does not exist in source-controller.

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
@matheuscscp matheuscscp requested a review from stefanprodan June 18, 2026 12:47
@matheuscscp matheuscscp added bug Something isn't working backport:release/v1.2.x To be backported to release/v1.2.x labels Jun 18, 2026
@matheuscscp

Copy link
Copy Markdown
Member Author

Tested in my EKS clusters, fix works:

Screenshot from 2026-06-18 13-57-01

@stefanprodan stefanprodan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Great find! thanks @matheuscscp

@matheuscscp matheuscscp merged commit 608610c into main Jun 18, 2026
12 checks passed
@matheuscscp matheuscscp deleted the fix-timeout branch June 18, 2026 13:35
@fluxcdbot

Copy link
Copy Markdown
Member

Successfully created backport PR for release/v1.2.x:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:release/v1.2.x To be backported to release/v1.2.x bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants