Clone Tools
  • last updated a few seconds ago
Constraints: committers
Constraints: files
Constraints: dates
Fix concurrency bug in `HttpClientHelper`

The HTTP context should not be shared by several requests, or it just breaks when requests are done in parallel.

This explains the failures seen with `NTLM` authentication, but not only: there were more failures with `BASIC`

authentication too (and probably random other failures).

This commit changes the `HttpContext` so that we create a new one per request, in case we don't use authentication,

and if we do, then requests cannot be done in parallel (until we find a proper fix). This removes the special case in


  1. … 4 more files in changeset.
Use DefaultHttpBuildCacheServiceFactory to create a build cache in test

+review REVIEW-6478

  1. … 1 more file in changeset.
Use the same HttpClient configuration for the HTTP build cache

+review REVIEW-6478

  1. … 7 more files in changeset.
Do not restrict simultaneous HTTP connections per host

The maximum number of simultaneous HTTP connections is configured

as 20, but previously this was further limited to 2 per 'route'.

This commit removes the per-route limit. The overall maximum

connections is unchanged.

Address code review comments

+review REVIEW-6323

  1. … 2 more files in changeset.
Ensure ExternalResourceReadResponse are correctly closed

Digged inside the code to find all code path leading to the

instantiation of ExternalResourceReadResponse class and verify the

resource is properly closed.

+review REVIEW-6323

  1. … 5 more files in changeset.
Fixed failing integration tests due to `null` being returned instead of a proper http response

  1. … 2 more files in changeset.
Merge branch 'max-age' of into DanielThomas-max-age

  1. … 7 more files in changeset.
Do not require password for truststore (#697)

Because it throws an apache http SSLInitializationException it was

misleading as to what was really the cause of a password being

required for the use of a custom truststore.

+review REVIEW-6256

  1. … 1 more file in changeset.
Improve error handling if Http Response has no content

We did get a NPE when an artifact repository returned `304`.

This should never happen but with this error handling we

at least see what went wrong.

  1. … 1 more file in changeset.
Close HttpResponse in finally block



Close responses from httpclient

Since Apache HttpClient 4.3 `(Closable)HttpResponse`s

need to be closed. Gradle has not been doing that after

the upgrade to HttpClient 4.4. This probably caused some

resource problems.


  1. … 3 more files in changeset.
Merge pull request #690 from kiddouk:story/S3-repository-can-be-configured-to-authenticate-using-AWS-EC2-instance-metadata

S3 repository can authenticate using AWS EC2 instance metadata

* This is related to

* Note that the AWS S3 Client implementation will now use the following

credentials (in this specific order)



- Java System Properties - aws.accessKeyId and aws.secretKey

- Credential profiles file at the default

location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI

- Instance Profile Credentials - delivered through the Amazon EC2

metadata service

* The implementation assumes that only ONE authentication can be used

per s3-resource at a time

* This patch enforces that each Authentication now declares

`requiresCredentials` to be explicit

Integration tests:

Note that we cannot mock the instance meta data since it uses the ip so we mock the system properties that the client

CredentialsProviderChain will look for.

  1. … 21 more files in changeset.
Replace usage of `String#format` with good old string concatenation

The rationale behind this change is that while `String#format` is usually admitted as good for readability (this is arguable),

in practice it is very bad for performance. Since Java 6, the JVM (the JIT, to be correct) does a pretty good job at optimizing

string concatenation. However, it is only capable to do so if we're using "dirty" string concatenations (using `+`), or `StringBuilder`.

However, usage of `StringBuilder` is not recommended either for 2 reasons:

1. it significantly decreases code readability

2. in Java 9, String concatenation is even more optimized thanks to `invokedynamic`, and code using `StringBuilder` will *not* benefit

from this optimization.

There are sill leftover `String#format` calls in the code, in the following cases:

- the call is used to generate an exception message. That's 90% of the remaining calls.

- the call is obviously a debug message, often used in `toString` (because as we all know, `toString` should only be used for debugging)

- the format includes specific number formatting patterns

- I missed it

  1. … 225 more files in changeset.
GRADLE-3424 Enable default httpclient retry handler

* GRADLE-3424 Enable default httpclient retry handler

  1. … 1 more file in changeset.
GRADLE-3424 Enable default httpclient retry handler

* GRADLE-3424 Enable default httpclient retry handler

  1. … 1 more file in changeset.
Add ability to revalidate external resource requests

The argument allows Cache-Control: max-age=0 to be added in cases where it's desirable for artifact repositories or caching proxies to revalidate requests:

- Listing version metadata

- Resource has exceeded it's cache lifetime on disk, such as dynamic/snapshot dependencies or when --refresh-dependencies is specified

  1. … 22 more files in changeset.
Merged internal `ResourceException` into public `ResourceException`.

  1. … 36 more files in changeset.
Renamed `o.g.internal.resource.Resource` to `TextResource`.

  1. … 34 more files in changeset.
Cleaned out a bunch of TODOs

  1. … 30 more files in changeset.
Use system default route planner when configuring http client

- This change will now use the appropriate proxy depending on the target URL

- This means HTTP proxy with be used for nonsecure connections and HTTPS proxy for secure connections, exclusively

- The old implementation used the HTTPS proxy for all connections if one was configured

Disable https tests for now.

+review REVIEW-5736

  1. … 1 more file in changeset.
Use fully-qualified @o.g.a.Incubating in packages

This is a less verbose, less awkward syntax and allows for simpler

programmatic addition / removal when neccessary.

    • -3
    • +1
  1. … 35 more files in changeset.
Synchronize calls to close() as well

+review REVIEW-5736

Revert "Only synchronize client access when initializing"

This reverts commit d3c545239c9c810f659e398443cb3d2a020fde9e.

Only synchronize client access when initializing

+review REVIEW-5736

Fix potential thread safety issue

+review REVIEW-5736

Defer creating an http client until making an HTTP request.

+review REVIEW-5736

Add caching of ssl contexts

+review REVIEW-5736

    • -0
    • +23
  1. … 3 more files in changeset.
Make proxy configuration more explicit

- No longer rely on HttpClient to inspect system properties for proxy settings

- Use configuration attained from `JavaSystemPropertiesProxySettings` to configure HttpClient

- Prefer HTTPS proxy if one is defined otherwise we fallback to unsecure

+review REVIEW-5736

Update HttpClient to 4.4.1

- This bumps httpclient to 4.4.1 and httpcore to 4.4.4

- Update ':docs' subproject to use same httpclient version to avoid duplicate libraries in IntelliJ

- Incorporated fix for GRADLE-3029 by synchronizing access to 'java.home' system property

- This commit also resolves GRADLE-3250 since SNI support was added in httpclient 4.3.2

+review REVIEW-5736

  1. … 11 more files in changeset.