-
Notifications
You must be signed in to change notification settings - Fork 173
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
increase the timeouts for report API calls to 600 seconds #1412
Conversation
Why even have a default timeout? Users can specify one via |
The default comes from the Network.HTTP.Req library. Search for "responseTimeout" on this page: https://hackage.haskell.org/package/req-3.13.2/docs/Network-HTTP-Req.html#g:12 |
In that case, is there a benefit to not setting the timeout to some huge value like |
Yeah, I'm open to that. I initially had it at 600 seconds and thought it was maybe too much, but I'm happy to go with 600 seconds. I think we set it to 600 seconds already for one of the VSI endpoints. |
@@ -1183,6 +1183,8 @@ getAttributionJson apiOpts ProjectRevision{..} = fossaReq $ do | |||
=: True | |||
<> "dependencyInfoOptions[]" | |||
=: packageDownloadUrl | |||
-- Large reports can take over a minute to generate, so increase the timeout to 10 minutes | |||
<> responseTimeoutSeconds 600 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine, but I think it would be good to have a top-level defaultResponseTimeout
and refer to that rather than write 600 in both places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default is actually 30 seconds (from the library), and we are overriding it here.
The default comes from the Network.HTTP.Req library. Search for "responseTimeout" on this page: https://hackage.haskell.org/package/req-3.13.2/docs/Network-HTTP-Req.html#g:12
Overview
No Ticket
See https://teamfossa.slack.com/archives/C043EM3L96Z/p1713304985656999
We were having a problem running
fossa attribution report --format html ...
for a project that was taking a long time to run the report.The fix is to increase the timeout when we hit the reports API.
Acceptance criteria
We can generate the report without timing out.
Testing plan
Do this in an empty directory with no git repo in it or its parents:
Repeat with
--format json
.Note that it takes > 30 seconds to run, but it does not take forever.
The previous behavior was that it would make the API call, timeout after 30 seconds, and then try again. I don't know if it ever gave up or if it just kept trying forever.
Risks
The report in question takes a bit over a minute to generate. Increasing the timeout to 5 minutes should be enough, but if you think it should be larger (10 minutes?) I'm totally willing to bump it up.
Metrics
References
https://teamfossa.slack.com/archives/C043EM3L96Z/p1713304985656999
Checklist
docs/
.docs/README.ms
and gave consideration to how discoverable or not my documentation is.Changelog.md
. If this PR did not mark a release, I added my changes into an# Unreleased
section at the top..fossa.yml
orfossa-deps.{json.yml}
, I updateddocs/references/files/*.schema.json
AND I have updated example files used byfossa init
command. You may also need to update these if you have added/removed new dependency type (e.g.pip
) or analysis target type (e.g.poetry
).docs/references/subcommands/<subcommand>.md
.