Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Relax what we check for in the daemon health stats unit test

Make test Locale independent

Introduce test that simulates GC activity

    • -3
    • +3
    ./health/gc/GarbageCollectionMonitorTest.groovy
  1. … 5 more files 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

    • -14
    • +12
    ./health/DaemonHealthStatsTest.groovy
    • -100
    • +55
    ./health/DaemonMemoryStatusTest.groovy
    • -0
    • +53
    ./health/LowHeapSpaceDaemonExpirationStrategyTest.groovy
    • -0
    • +53
    ./health/LowNonHeapDaemonExpirationStrategyTest.groovy
    • -53
    • +0
    ./health/LowPermGenDaemonExpirationStrategyTest.groovy
    • -53
    • +0
    ./health/LowTenuredSpaceDaemonExpirationStrategyTest.groovy
    • -23
    • +4
    ./health/gc/GarbageCollectionMonitorTest.groovy
    • -13
    • +54
    ./health/gc/GarbageCollectionStatsTest.groovy
  1. … 18 more files in changeset.
spelling: daemon

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Signed-off-by: Bo Zhang <bo@gradle.com>

    • -1
    • +1
    ./scaninfo/DefaultDaemonScanInfoSpec.groovy
Allow starting daemon with lower priority

    • -2
    • +3
    ./DaemonRegistryUnavailableExpirationStrategyTest.groovy
  1. … 22 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. … 14 more files in changeset.
Address review feedback

- change parameter ordering in DefaultDaemonScanInfo

    • -3
    • +3
    ./scaninfo/DefaultDaemonScanInfoSpec.groovy
  1. … 2 more files in changeset.
Expose single run daemon usage in DaemonScanInfo

    • -3
    • +3
    ./scaninfo/DefaultDaemonScanInfoSpec.groovy
  1. … 12 more files in changeset.
Strive to keep Gradle's monotonic clock in sync with the system clock

    • -2
    • +1
    ./scaninfo/DefaultDaemonScanInfoSpec.groovy
  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.

    • -2
    • +2
    ./scaninfo/DefaultDaemonScanInfoSpec.groovy
  1. … 178 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

    • -2
    • +2
    ./scaninfo/DefaultDaemonScanInfoSpec.groovy
  1. … 22 more files in changeset.
Fix codenarc issue

    • -1
    • +0
    ./scaninfo/DefaultDaemonScanInfoSpec.groovy
Simplify unregistration of listeners in DefaultDaemonScanInfo

    • -25
    • +27
    ./scaninfo/DefaultDaemonScanInfoSpec.groovy
  1. … 1 more file in changeset.
Fix deadlock in `DefaultDaemonScanInfo`

This commit fixes a deadlock encountered from time to time on CI. The reason for the deadlock is that we're trying to remove

the same listener from 2 different notifications, one of them being the listener being removed itself. To avoid this, we just

tell the other listener that we're taking care of it by setting the reference to null.

    • -2
    • +28
    ./scaninfo/DefaultDaemonScanInfoSpec.groovy
  1. … 1 more file in changeset.
Fix memory leak in DefaultDaemonScanInfo

- also unregister the listener that was listening for

the buildFinished event

Fixes #1730

    • -0
    • +82
    ./scaninfo/DefaultDaemonScanInfoSpec.groovy
  1. … 1 more file in changeset.
Do not wait on memory status event on daemon startup

We only need Runtime.getRuntime().maxMemory() in DaemonHealthStats

    • -10
    • +2
    ./health/DaemonHealthStatsTest.groovy
  1. … 2 more files in changeset.
Refine memory sampling event publishing

Merge MemoryStatusBroadcaster into MemoryManager

Broadcast start/stop is now isolated in MemoryManager

DaemonHealthStats wait for one JVM memory event

Strengthen tests around health logging

Services depend on ExecutorFactory to use ScheduledExecutorServices

And stop them properly

  1. … 14 more files in changeset.
Refine memory sampling event publishing

Move MemoryStatusBroadcaster startup to DefaultGradleLauncherFactory

Add support for ScheduledExecutors to ExecutorFactory

& Stoppable & honoring ExecutorPolicy

Move global scheduled executor creation to GlobalScopeServices

Don’t use anonymous broadcasters

DaemonHealthStats now consume memory sampling events

  1. … 20 more files in changeset.
Split JVM/OS memory events and add coverage

    • -6
    • +6
    ./health/LowMemoryDaemonExpirationStrategyTest.groovy
  1. … 16 more files in changeset.
Move process memory related code into :core

    • -1
    • +1
    ./health/LowMemoryDaemonExpirationStrategyTest.groovy
    • -132
    • +0
    ./health/memory/MeminfoAvailableMemoryTest.groovy
    • -57
    • +0
    ./health/memory/MemoryInfoTest.groovy
    • -53
    • +0
    ./health/memory/VmstatAvailableMemoryTest.groovy
  1. … 35 more files in changeset.
Initial implementation of an event-based memory broadcaster

    • -14
    • +33
    ./health/LowMemoryDaemonExpirationStrategyTest.groovy
  1. … 12 more files in changeset.
Fix flakiness when nanoTime does not increment

Use `Timers` in ':launcher' subproject

  1. … 3 more files in changeset.
Moved `Clock` and `TimeProvider` into a separate package

This commit reverts recent changes to the API of

`org.gradle.util.Clock`, and instead deprecates the existing type

replacing with a new internal type. This was done because the

`ExtractDslMetaDataTask` uses this type for timing, and external plugins may have copied this pattern.

`org.gradle.util.Clock` is now deprecated.

  1. … 103 more files in changeset.
Use shared Clock instance for tracking time in DaemonRunningStats

  1. … 4 more files in changeset.
Remove unnecessary timestamp parameter for idle duration

This change allows the idle duration to be determined entirely within

the `DaemonStateCoordinator` using `System.nanoTime`.

    • -2
    • +2
    ./DaemonIdleTimeoutExpirationStrategyTest.groovy
  1. … 2 more files in changeset.
Don't call System.gc after the build

  1. … 2 more files in changeset.
Fix meminfo reading on Linux systems.

- Improve calculation of free memory on Linux 3.x where MemAvailable

is not available. Add Linux 3.x tests

- Break MemoryInfo apart into classes using Strategy pattern for

getting available memory depending on OS

- Eliminate unnecessary logic in LowMemoryDaemonExpirationStrategy

+review REVIEW-6218

    • -45
    • +14
    ./health/LowMemoryDaemonExpirationStrategyTest.groovy
    • -0
    • +132
    ./health/memory/MeminfoAvailableMemoryTest.groovy
    • -0
    • +57
    ./health/memory/MemoryInfoTest.groovy
    • -0
    • +53
    ./health/memory/VmstatAvailableMemoryTest.groovy
  1. … 12 more files in changeset.
Aggressively terminate duplicate idle Daemons under low memory.

- Set reasonable threshold bounds of 384Mb to 1Gb for low memory

detection.

- Reduce idle timeout to 10 seconds for Daemons that are not

most recently used when available system memory is < 5% of total.

+review REVIEW-6215

    • -11
    • +27
    ./health/LowMemoryDaemonExpirationStrategyTest.groovy
  1. … 2 more files in changeset.