Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Switch to GradleSystem.getenv()

This commit replaces all System.getenv() with GradleSystem.getenv() in Gradle code base.

    • -2
    • +3
    ./internal/inet/InetAddressFactory.java
  1. … 23 more files in changeset.
Preliminary support for building Gradle on Java 9 (#5811)

This is a follow-up of https://github.com/gradle/gradle/pull/5749 . #5749 introduced Java 9 compiler but broke IDE import. This PR aims at fixing IDE import. With this PR, we can run `./gradlew idea` and set project SDK to JDK 9 to run integration tests.

The changes are:

- Upgrade javaassist to JDK9-compatible version

- Adds empty implementation to `AnnotationProcessingCompileTask` and `ResourceCleaningCompilationTask`

- Remove support of Java 5 because Java 9 can't generate Java 5 bytecode any more.

- Slightly increased wrapper size limitation because two extra classes are added.

  1. … 21 more files in changeset.
Fix NPE on QEMU (#5199)

Iterate only if Enumeration is not null

Signed-off-by: Alexandre Bouthinon <bouthinon.alexandre@gmail.com>

Fix for JUnitFailFastIntegrationTest flaky test (#4625)

* Added ObjectConnection.stopNow() to handle fail fast causing flaky, unexpected stacktrace

* Optimized imports

* Only stopNow() on ObjectConnection if non-null

* Updates from review comments

* Abort ObjectConnection if DefaultWorkerProcess has been aborted first

    • -1
    • +10
    ./internal/hub/MessageHubBackedObjectConnection.java
  1. … 2 more files in changeset.
Replace usages of org.gradle.api.Nullable

With javax.annotation.Nullable.

  1. … 460 more files in changeset.
Simplify executor relationships

    • -2
    • +2
    ./internal/inet/TcpIncomingConnector.java
  1. … 45 more files in changeset.
Remove guava from worker process path

    • -2
    • +1
    ./internal/hub/MessageHubBackedObjectConnection.java
  1. … 15 more files in changeset.
Fix gaps in serialization error handling in workers

  1. … 1 more file in changeset.
Use `Serializer.equals` when comparing parameters for cache reuse (#1019)

* Add test cases for gradle/gradle#933. The focus is been put on `DefaultCacheAccess.newCache`.

* Fix gradle/gradle#933. By implementing `equals`/`hashCode` for `Serializer` and using then for cache equality.

    • -1
    • +1
    ./internal/hub/JavaSerializationBackedMethodArgsSerializer.java
  1. … 36 more files in changeset.
Use debug logging for querying IP addresses

Warn shows up in the stack trace and it is basically never a problem.

It looks like some ephemeral network devices can become unavailable

during scanning.

Handle serialization exceptions gracefully in worker daemons

- Add StreamFailureMessage message type

- Have MessageHub receiver/dispatcher catch object stream errors, inject StreamFailureMessage, and continue processing instead of exiting

- Catch object stream errors in SocketConnection and throw a typed exception

    • -0
    • +26
    ./internal/RecoverableMessageIOException.java
    • -11
    • +18
    ./internal/hub/MessageHubBackedObjectConnection.java
    • -0
    • +27
    ./internal/hub/StreamFailureHandler.java
    • -0
    • +36
    ./internal/hub/protocol/StreamFailureMessage.java
  1. … 6 more files in changeset.
Address review items

- don't register core classloader when registering incoming messages

- remove unused overload of ObjectConnectionBuilder#addIncoming

- cleanup WorkerDaemonServiceIntegrationTest

    • -5
    • +7
    ./internal/hub/MessageHubBackedObjectConnection.java
  1. … 2 more files in changeset.
Fix classloading issues when having multiple message types in ObjectConnection

    • -12
    • +26
    ./internal/hub/MessageHubBackedObjectConnection.java
  1. … 3 more files in changeset.
Allow multiple `SerializerRegistry` instances to be associated with an `ObjectConnection`, to allow different strategies to be used for different kinds of messages sent over the connection.

    • -4
    • +19
    ./internal/hub/DefaultMethodArgsSerializer.java
    • -9
    • +12
    ./internal/hub/MessageHubBackedObjectConnection.java
  1. … 4 more files in changeset.
Ignore non-queryable devices when finding own IP addresses

This was the probably cause of a flaky test which failed with

```

Caused by: java.lang.RuntimeException: Could not determine the IP addresses for network interface vethdf3543b

at org.gradle.internal.remote.internal.inet.InetAddresses.analyzeNetworkInterface(InetAddresses.java:95)

at org.gradle.internal.remote.internal.inet.InetAddresses.analyzeNetworkInterfaces(InetAddresses.java:50)

at org.gradle.internal.remote.internal.inet.InetAddresses.<init>(InetAddresses.java:40)

at org.gradle.internal.remote.internal.inet.InetAddressFactory.init(InetAddressFactory.java:100)

at org.gradle.internal.remote.internal.inet.InetAddressFactory.getLocalBindingAddress(InetAddressFactory.java:85)

... 58 more

Caused by: java.net.SocketException: No such device

at org.gradle.internal.remote.internal.inet.InetAddresses.analyzeNetworkInterface(InetAddresses.java:57)

... 62 more

```

The test was `UserGuideSamplesIntegrationTest#scalaCrossCompilation`

+review REVIEW-6311

Writing the socket hostname is not necessary

+review REVIEW-6180

    • -2
    • +1
    ./internal/inet/SocketInetAddress.java
Add faster implementation of serialization of `Address`

This commit fixes the slow serialization of `Address` instances by implementing a custom serializer which

knows about the various `Address` implementations we use, and avoids calls to `ObjectInputStream`.

    • -0
    • +29
    ./internal/inet/SocketInetAddress.java
  1. … 3 more files in changeset.
Changed `Test` task to lookup host name once per build process rather than for each test instance.

    • -0
    • +14
    ./internal/inet/InetAddressFactory.java
  1. … 5 more files in changeset.
Refactor InetAddressFactory

The main reason for this refactoring was to make

InetAddressFactory easier to understand. I also extracted

the responsibility of obtaining the InetAddresses from

the NetworkInterfaces in a different class. The only

responsibility of InetAddressFactory is now to provide

enough data for two processes to communicate via

IP addresses. As a side effect InetAddressFactory is now testable.

The allow remote flag is still useful, therefore it has not been removed.

Setting it allows connections from a remote machine.

#644

+review REVIEW-6069

    • -139
    • +44
    ./internal/inet/InetAddressFactory.java
    • -0
    • +121
    ./internal/inet/InetAddresses.java
    • -3
    • +3
    ./internal/inet/TcpIncomingConnector.java
  1. … 4 more files in changeset.
Allow local connections for daemon and messaging services from all network devices (#644)

This fixes common issue on FreeBSD jails when loopback interface

provides no IP addresses due to security reasons.

The fix finally uses a different fallback strategy for findLocalAddresses(). Allowing remote connections

in general had a performance impact since then also the connection was made via the remote interface and not

via the loopback interface.

GRADLE-3121

+review REVIEW-6069

    • -4
    • +12
    ./internal/inet/InetAddressFactory.java
Revert "Allow local connections for daemon and messaging services from all network devices (#644)"

This causes a significant (~10 second) delay connecting to the Daemon.

We'll have to solve this another way.

This reverts commit df26a299e3182b330d0f4e33074e13436a4f4b59.

    • -1
    • +1
    ./internal/hub/MessageHubBackedServer.java
  1. … 1 more file in changeset.
Allow local connections for daemon and messaging services from all network devices (#644)

This fixes common issue on FreeBSD jails when loopback interface

provides no IP addresses due to security reasons.

GRADLE-3121

    • -1
    • +1
    ./internal/hub/MessageHubBackedServer.java
  1. … 1 more file in changeset.
Change `InetAddressFactory` so that it no longer uses reflection to inspect `NetworkInterface`

+review REVIEW-6046

    • -70
    • +7
    ./internal/inet/InetAddressFactory.java
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
    • +1
    ./internal/hub/protocol/EndOfStream.java
    • -1
    • +1
    ./internal/inet/MultiChoiceAddress.java
    • -1
    • +1
    ./internal/inet/SocketConnectCompletion.java
    • -1
    • +1
    ./internal/inet/SocketInetAddress.java
    • -1
    • +1
    ./internal/inet/TcpIncomingConnector.java
  1. … 220 more files in changeset.
Busted up some package cycles and switched on classcycle checks for 'messaging' project.

    • -57
    • +0
    ./internal/PlaceholderException.java
    • -1
    • +1
    ./internal/hub/JavaSerializationBackedMethodArgsSerializer.java
    • -0
    • +86
    ./services/MessagingServices.java
  1. … 28 more files in changeset.
Moved `o.g.messaging.*` to `o.g.internal.*`.

    • -0
    • +33
    ./ConnectionAcceptor.java
    • -0
    • +28
    ./MessagingClient.java
    • -0
    • +32
    ./MessagingServer.java
    • -0
    • +43
    ./ObjectConnection.java
    • -0
    • +57
    ./ObjectConnectionBuilder.java
    • -0
    • +32
    ./internal/ConnectCompletion.java
    • -0
    • +22
    ./internal/ConnectException.java
    • -0
    • +37
    ./internal/Connection.java
    • -0
    • +31
    ./internal/IncomingConnector.java
    • -0
    • +37
    ./internal/KryoBackedMessageSerializer.java
    • -0
    • +220
    ./internal/Message.java
    • -0
    • +22
    ./internal/MessageIOException.java
    • -0
    • +35
    ./internal/MessageSerializer.java
    • -0
    • +83
    ./internal/MessagingServices.java
  1. … 281 more files in changeset.