Clone Tools
  • last updated a few seconds ago
Constraints: committers
Constraints: files
Constraints: dates
Add integration test that fails if Gradle does not understand the JVM's GC settings

    • -37
    • +0
    • -0
    • +47
  1. … 1 more file in changeset.
Rework daemon GC/memory expiration checks

- Do not sniff for VM vendor to figure out which GC strategies may be used

- Rename permgen -> non-heap in most places, Java 8+ uses metaspace for this memory pool

- Rename tenured -> heap

- Only add GarbageCollectionEvents to the observation window when there's been a GC collection

- This simplifies the calculation of GC rate

- Non-heap memory pools are not GC'd

- Re-enable daemon performance soak test

    • -77
    • +34
    • -2
    • +2
    • -0
    • +46
    • -0
    • +45
    • -45
    • +0
    • -46
    • +0
    • -2
    • +12
    • -23
    • +30
    • -3
    • +3
    • -70
    • +23
    • -86
    • +68
    • -22
    • +22
  1. … 11 more files in changeset.
Change SystemProperties standard/important property methods

Instead of returning a set and having call sites call contains, just return a boolean.

  1. … 2 more files in changeset.
Represent the result of `BuildActionExecuter.execute()` as an object that encapsulates either a result object or a failure, rather than as an opaque return value or a thrown `ReportedException`.

  1. … 23 more files in changeset.
Fix metaspace leak in ShutdownHookActionRegister

This class added a shutdown hook and never removed it,

which created a classloader leak whenever it was used

in an embedded context, e.g. in the in-process Groovy


The approach of having a single hook with multiple actions

seems like a premature optimization. Creating a Thread object

is not expensive, starting it is. The class now just serves

as a convenience for adding/removing shutdown hooks, but creates

one thread per hook, so it can be correctly removed again.

  1. … 4 more files in changeset.
Allow starting daemon with lower priority

  1. … 23 more files in changeset.
Replace deprectated `IOUtils.closeQuietly` uses with `IoActions.closeQuietly`

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

    • -0
    • +92
  1. … 36 more files in changeset.
Make environment variable mutation work on Java9+

Mutating the environment requires reflection on the

java.util package, so we need to open that package

up to Gradle. Since Gradle is not modularized, this

means opening it up to the whole classpath. This is

less than desirable, but the only way to restore the

behavior we had on Java 8 and below.

We should start limiting access to environment variables

going forward so users don't depend on arbitrary values.

However, this change allows us to unblock users who are

currently either not using Java 9 or running Gradle in

no-daemon mode, both of which are terrible solutions.

  1. … 11 more files in changeset.
Fix tests, mark more internal listeners

  1. … 22 more files in changeset.
Switch to GradleSystem.getenv()

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

  1. … 23 more files in changeset.
Honor singleUse when creating GlobalScopeServices (#5966)

Previously, DaemonServerConfiguration.isSingleUse is totally ignored

when creating GlobalScopeServices, which makes GradleBuildEnvironment.isLongLivingProcess()

always return true. This commit fixes this issue.

  1. … 1 more file in changeset.
Add Gradle.getenv() api

  1. … 9 more files in changeset.
Make OutputEventRenderer asynchronous

  1. … 5 more files in changeset.
Avoid spurious failures during connection tear-down

Remove remaining Java serialization from the initial build request message sent from the client to the daemon. There is now no Java serialization used between the client and daemon when running builds from the command-line. There is still some when using the Tooling API.

  1. … 23 more files in changeset.
Don't emit a warning that the “daemon will cancel the build”.

This makes no sense to users.

  1. … 1 more file in changeset.
Close after build

  1. … 1 more file in changeset.
Rename to EndOnClosedInputStream

Attempt to fix

This PR adds a guard for PipedInputStream to make sure it's safe to

read after being closed.

  1. … 4 more files in changeset.
Address review feedback

- use DaemonServerConfiguration to pass information further down

- remove BuildAndStop command

- change naming to use singleUse

+review REVIEW-6567

  1. … 10 more files in changeset.
Address review feedback

- change parameter ordering in DefaultDaemonScanInfo

  1. … 1 more file in changeset.
Add marker annotation and proper javadoc

Expose single run daemon usage in DaemonScanInfo

  1. … 11 more files in changeset.
Strive to keep Gradle's monotonic clock in sync with the system clock

  1. … 70 more files in changeset.
Simplify time handling internally and for build scans (#2857)

* Don't make TimeProvider Serializable.

This isn't safe and generally doesn't make sense.

* Extract and promote the concept of a build timer.

This was previously not well defined and being overlaid with the concept of when a user/tool requested something, which is not always the same thing.

* Pare down the deprecated org.gradle.util.Clock down to the minimum required.

Internal usage is replaced by a `getStartTime()` directly on BuildRequestContext.

What is left is only kept for backwards compatibility with scans.

* Rename TimeProvider to Clock.

* Move BuildExecutionTimer out of baseServices into core, and into a better package.

* Remove unused.

* Simplify the time package by merging types.

* Prevent the client's build started timestamp from being later than when the provider received the build request.

* Provide a dedicated mechanism for conveying the build start time to build scans.

* Consolidate the ways of formatting durations.

  1. … 177 more files in changeset.
Split out `Timer` from `EventTimer`

- `Timer` has no wall-clock time, and only measure relative/elapsed time

- `EventTimer` (nee `Clock`) has a wall-clock start time, plus

an elapsed time measure.

- Removed the need for wall-clock time in CountdownTimer

- Renamed `org.gradle.internal.time.Clock` -> `DefaultEventTimer`

Renamed Clock -> EventTimer

  1. … 20 more files in changeset.
Apply logs throttling to stdout and stderr

Pull up ThrottlingOutputEventListener so it is the first listener

to receive and queue log events, flushing them every 100ms or so.

Generate UpdateNowEvents during cleanup of logging manager and

forward them immediately to ensure logs for standard streams

are flushed before those streams' listeners are removed.

Issue: #2221

  1. … 7 more files in changeset.
Replace usages of org.gradle.api.Nullable

With javax.annotation.Nullable.

  1. … 459 more files in changeset.
Ignore expire daemon message during output comparison in tests

    • -1
    • +2
  1. … 1 more file in changeset.