Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/lib/dependabot/shared_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def self.excon_defaults(options = nil)
connect_timeout: 5,
write_timeout: 5,
read_timeout: 20,
retry_limit: 4, # Excon defaults to four retries, but let's set it explicitly for clarity
omit_default_port: true,
middlewares: excon_middleware,
headers: excon_headers(headers)
Expand Down
1 change: 1 addition & 0 deletions common/spec/dependabot/shared_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ def existing_tmp_folders
connect_timeout: 5,
write_timeout: 5,
read_timeout: 20,
retry_limit: 4,
omit_default_port: true,
middlewares: described_class.excon_middleware,
headers: described_class.excon_headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ def fetch_remote_parent_pom(group_id, artifact_id, version, repo_urls)
@maven_responses[url] ||= Excon.get(
url,
idempotent: true,
# We attempt to find dependencies in private repos before failing over to the CENTRAL_REPO_URL,
# but this can burn a lot of a job's time against slow servers due to our `read_timeout` being 20 seconds.
#
# In order to avoid the overall job timing out, we only make one retry attempt
retry_limit: 1,
**SharedHelpers.excon_defaults
)
next unless @maven_responses[url].status == 200
Expand Down