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

Enforce timeout on vcsLister.List() #1884

Open
colinodell opened this issue Sep 8, 2023 · 1 comment
Open

Enforce timeout on vcsLister.List() #1884

colinodell opened this issue Sep 8, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Great issues for new Athenians to work on!

Comments

@colinodell
Copy link

Is your feature request related to a problem? Please describe.

When listing available versions for certain modules, vcsLister.List() can sometimes take several minutes to execute. I would like to configure a timeout on that operation so proxy users aren't stuck waiting that long for a response.

Describe the solution you'd like

Have the vcsLister respect the existing ATHENS_TIMEOUT setting already used by storage backends.

Describe alternatives you've considered

None

Additional context

Run go list -m -versions -json github.com/aws/aws-sdk-go-v2/credentials/v2@latest to see an example of one such module that takes a really long time to list versions for.

Here's a trace from athens for that same module:

image

@ngshiheng
Copy link
Contributor

ngshiheng commented Sep 22, 2023

I actually like the idea of having a timeout for this. I recently stumbled upon a similar situation.

Just to give a quick comparison, Go's official module proxy mirror responds almost immediately when we do: https://proxy.golang.org/github.com/grpc-ecosystem/grpc-gateway/v3/@v/list (404)

On the other hand, https://athens.private.com/github.com/grpc-ecosystem/grpc-gateway/v3/@v/list took ~9s to return 200. For bigger modules like aws-sdk-go, it could take much longer as you described.

Response code aside, I'm not sure if Athens wants to do the same thing here. Maybe others can chime in.

Anyway, @colinodell i see that you're using Renovate for this from your user-agent. Here's how I reduced the response wait time when using Renovate (35.138.1-slim):

hostRules: [
        {
            hostType: "go-proxy",
            description: "Avoid waiting 1 min/req to wait for go-proxy to respond if a module version list does not exist",
            timeout: 5000, // milliseconds
        },
    ],

I hope this can temporarily relieve the wait a bit for your use case

@matt0x6F matt0x6F added enhancement New feature or request good first issue Great issues for new Athenians to work on! labels Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Great issues for new Athenians to work on!
Projects
None yet
Development

No branches or pull requests

3 participants