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

Set timeouts on notary requests during build #1287

Merged
merged 4 commits into from
Aug 8, 2023

Conversation

RebeccaMahany
Copy link
Contributor

@RebeccaMahany RebeccaMahany commented Aug 8, 2023

We added a retry in #1278, but I saw in a recent job that we were only trying 1 request:

ts=2023-08-08T16:30:47.947216363Z
caller=logutil.go:13
severity=info
msg="Target Failed"
err="bootstrap notary GUN kolide/launcher: timeout after 5m0s (1 attempts): getting all target metadata: unable to reach trust server at this time: 500."
target=generate-tuf

It looks like this is because we don't have a timeout set. This PR updates the transport we use when talking to notary to set some timeouts.

@RebeccaMahany RebeccaMahany changed the title Use http.DefaultTransport so notary requests will time out sooner, allowing for retries Set timeouts on notary requests during build Aug 8, 2023
@RebeccaMahany RebeccaMahany marked this pull request as ready for review August 8, 2023 17:58
@@ -441,7 +442,7 @@ func (b *Builder) execBindata(ctx context.Context, dir string) error {
return nil
}

func bootstrapFromNotary(notaryConfigDir, remoteServerURL, localRepo, gun string) error {
func bootstrapFromNotary(notaryConfigDir, remoteServerURL, localRepo, gun string, retryTimeout time.Duration, bootstrapTimeout time.Duration) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd hard code the values instead of passing. But whatev

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did this so the test wouldn't take 5min to run

@RebeccaMahany RebeccaMahany merged commit d4a44a4 into kolide:main Aug 8, 2023
24 checks passed
@RebeccaMahany RebeccaMahany deleted the becca/notary-timeout branch August 8, 2023 18:23
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.

2 participants