Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Use native-platform to determine the hostname of the current machine.

Split a separate service out of `InetAddressFactory` to do the hostname resolution.

    • -42
    • +0
    ./internal/inet/InetAddressFactory.java
  1. … 7 more files in changeset.
Use `hostname` on macOS to lookup local host name

This is to work around a five second lag when using the JDK approach, see https://bugs.openjdk.java.net/browse/JDK-8143378.

    • -7
    • +35
    ./internal/inet/InetAddressFactory.java
Use `hostname` on macOS to lookup local host name

This is to work around a five second lag when using the JDK approach, see https://bugs.openjdk.java.net/browse/JDK-8143378.

    • -7
    • +35
    ./internal/inet/InetAddressFactory.java
Inject hostname to OriginMetadataFactory

    • -1
    • +2
    ./internal/inet/InetAddressFactory.java
    • -0
    • +19
    ./internal/inet/package-info.java
  1. … 3 more files in changeset.
Inject hostname to OriginMetadataFactory

    • -1
    • +2
    ./internal/inet/InetAddressFactory.java
    • -0
    • +19
    ./internal/inet/package-info.java
  1. … 3 more files in changeset.
Handle 'Connection reset' as end-of-stream failures too

Use InetAddress.getLoopbackAddress to find loopback address

    • -1
    • +1
    ./internal/inet/InetAddressFactory.java
Rework `MessagingServices` so that it is just a provider of services and registered in the same way as other providers, rather than it being its own `ServiceRegistry` that is added as a service and then specific services manually located from it.

Also rework how the logging services are wired into the tooling API connections, so that the logging services registry is just a parent of the connection services in the same way as other scopes, rather than it being registered as a service as well as being a parent.

  1. … 8 more files in changeset.
Change ArrayLists, used as Queues to ArrayDeques and LinkedLists

removing the first element is linear in an ArrayList

    • -5
    • +11
    ./internal/hub/queue/MultiEndPointQueue.java
  1. … 9 more files in changeset.
Add missing @Override to all modules

Signed-off-by: Paul Merlin <paul@gradle.com>

    • -0
    • +2
    ./internal/hub/InterHubMessageSerializer.java
    • -0
    • +1
    ./internal/hub/MessageHubBackedClient.java
    • -0
    • +7
    ./internal/hub/MessageHubBackedObjectConnection.java
    • -0
    • +2
    ./internal/hub/MessageHubBackedServer.java
    • -0
    • +4
    ./internal/hub/MethodInvocationSerializer.java
    • -0
    • +1
    ./internal/hub/queue/EndPointQueue.java
    • -0
    • +1
    ./internal/hub/queue/MultiEndPointQueue.java
    • -0
    • +3
    ./internal/inet/MultiChoiceAddress.java
    • -0
    • +1
    ./internal/inet/SocketConnectCompletion.java
  1. … 985 more files in changeset.
Spelling (#8147)

Misspellings make it harder to search for things; they make it harder for people to understand code and descriptions; and sometimes they result in bugs.

This PR fixes quite a few typos.

  1. … 15 more files in changeset.
Revert "Merge pull request #7838 from gradle/eskatos/messaging/bind-loopback-if-available"

Listening to the loopback device seems to cause some connection issues

to the daemon from IDEA. Reverting the change for now.

This reverts commit 9a940b21ee06ed0b5c83b7d88f7d191a0d7a590e, reversing

changes made to 18b1f6e10f32f623986868bb39e083b49467b16e.

    • -30
    • +3
    ./internal/inet/InetAddressFactory.java
  1. … 6 more files in changeset.
Remove some unused code from `InetAddresses`.

  1. … 1 more file in changeset.
Prefer loopback bind address if available for IPC

Keep file lock communicator bound to wildcard address

Signed-off-by: Paul Merlin <paul@gradle.com>

    • -3
    • +30
    ./internal/inet/InetAddressFactory.java
  1. … 6 more files in changeset.
Prefer loopback bind address if available for IPC

Keep file lock communicator bound to wildcard address

Signed-off-by: Paul Merlin <paul@gradle.com>

    • -3
    • +30
    ./internal/inet/InetAddressFactory.java
  1. … 6 more files in changeset.
Handle unrecoverable errors in worker process (#6798)

We fork worker processes to do necessary work, such as test/start play application/run worker daemons, and control these worker processes via socket. However, if something is wrong in the worker processes' socket connection threads, the worker process might be stuck forever.

This PR makes an attempt by registering an "unrecoverable error handler" to `ObjectConnection`. If something unexpected happens, the worker can exit instead of hanging forever. This is not a perfect solution, but it's better than hanging forever. Also, the worker process can record the exceptions into a file to help people understand what's going on there.

    • -2
    • +22
    ./internal/hub/MessageHubBackedObjectConnection.java
  1. … 6 more files in changeset.
Fix handling of InterruptedExceptions

These exceptions were handled incorrectly throughout the whole

codebase, usually rethrown without restoring the interrupt status

or discarded entirely. This means that the system would not stop

executing even though the user wanted it to. In some cases this

also left the system in an inconsistent state, leading to deadlocks.

The most notable changes include:

- UncheckedException.rethrow automatically restores the interrupt status

- AsyncDispatch is guaranteed to deliver its messages, even when interrupted

- ExecHandle cancels the started process if it is interrupted while waiting

- ExecHandle disconnects from the process' output before killing it

- The worker API cancels the started work items if it is interrupted

- ManagedExecutors shut down immediately if they are interrupted while stopping

- We no longer log exceptions caused by interruption to the console

- Interrupting our caches no longer leaks file locks

    • -1
    • +1
    ./internal/hub/MessageHubBackedObjectConnection.java
  1. … 38 more files in changeset.
Remove dependency on Java 7 in our build (#6494)

### Context

Currently we need 3 JDKs to build Gradle:

- Java 7 to compile most code

- Our build runs on Java 8

- Java 9 to compile some code using Java 9 API.

Our goal is to use only one JDK. After this PR, we can:

- If running the build on Java 9/10, we can only use a single JDK.

- If running the build on Java 8, we still need an extra JDK to compile some code using Java 9 API. After we migrate all CI builds to Java 9/10, we may completely drop the support for running on Java 8.

However, with https://youtrack.jetbrains.com/issue/IDEA-197550 unsolved, we still can't run Gradle integration tests in IDEA with JDK 10. Everything else would work fine on JDK10.

#### Remove multiple compiler JDKs

Previously, we use different JDKs to compile different subprojects, which made things really complicated. This PR greatly simplify the compiler selection code, after this PR, we only need one single Java9-compatible JDK to compile all code.

#### Refine verification mechanism

Previously, we had verification for:

- If build cache enabled, verify the current build is running on Java 8 because CI is running on Java 8.

- If running some specific tasks (e.g. distribution generation), verify the build/compiler JDK is Oracle JDK.

This PR does the following improvements:

- Since all `Compile` tasks share a common compiler, verify that compiler is Java9-compatible. Oracle JDK is not mandatory.

- If running some specific tasks (e.g. distribution generation), verify the build/compiler JDK is Oracle JDK.

This PR collects these verification into a single plugin, instead of code everywhere previously.

  1. … 14 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.