Clone Tools
  • last updated a few seconds ago
Constraints: committers
Constraints: files
Constraints: dates
a rough spike of a native daemon client and native gradle launcher

    • -0
    • +3
    • -0
    • +124
Fixed ConcurrentSpecification after my last change.

It is safer to duplicate the constructor / init() method for now. It's not pretty so what I think I have to do next is move all the state and methods from the ConcurrentSpecification to some other object and simply delegate to it.

Tweaked ConcurrentSpecification so one can use it without extending from it.

Made it possible for the ConcurrentToolingApiIntegrationTest to participate in cross-version compatibility suite once M7 is released. For that we will need to use ConcurrentSpecification without actually extending from it.

remove redundant imports

GRADLE-1933 Tooling api thread safety.

- Some changes to the singleton services implementation to get back on track with memory footprint. Made the DistributionFactory a singleton.

- Added a little bit sanity coverage mostly for documentation purposes

GRADLE-1885 - reworked the jar and ear tasks to not create their tmp working space unless actually run.

The core problem is that AbstractTask#getTemporaryDir() actually creates the dir. This change introduces a new getTemporaryDirFactory() method on TaskInternal that returns Factory<File> (which delegates to getTemporaryDir()). This was a cheap way to do this for now, but doesn't seem quite right.

We should either make getTemporaryDir() not create the directory, or make getTemporaryDirFactory() public, but we can't do that because Factory is not public.

GRADLE-1933 Tooling api thread safety.

Some refactoring around embedded mode for the DefaultConnection. I'm not 100% sure if it is necessary to keep some state around for the DefaultConnection for the embedded mode so I left this as it worked before. We are not concerned about concurrency for the embedded tooling api at the moment, anyway.

GRADLE-1933 Tooling api thread safety.

Added explicit unit test coverage around shared connector services (though we have integ test coverage for that). It is very useful because it documents some of the design choices around tacking the tooling api concurrency. It should also give better pointers (than the integ test) in case some refactoring breaks the thread safety.

Added missing copyright statements.

Busted some tooling api consumer classes into a dedicated package

GRADLE-1933 Tooling api thread safety.

Removed one of the TODOs and decided that synchronizing the CachingToolingImplementationLoader is actually a good idea (e.g. there were alternatives). E.g. since our design makes it clear that ToolingImplLoader is a singleton it's natural to synchronize at that level and in exactly that part of the codebase.

GRADLE-1933 Tooling api thread safety.

-Decoupled our GradleConnector (first level api of the tooling api users) from dependency injection aspects of the connector services. E.g. GradleConnector does not know what services are singletons and does not make any decisions in that matter. Made sure that other potential clients of connector services would not make any decisions around DI / singletons. Stopped exposing all connector services but only those that are needed (this should make the codebase easier to understand).

-Added more assertions to the concurrent test case. They might prove fragile on the way (coupled with content of the messages) but they are extremely useful for me at the moment.

Switched this off temporarily.

- Fixed cache cleanup when tests have been executed. - Fixed compile task when it has already been run. - Int test fixes.

GRADLE-1801 - release the locks on task state cache while a task's actions are running.

- Fix to make sure task state caches are closed at the end of build. - Fix for loading entries from archive cache.

- Moved the lazy open stuff to DefaultTaskArtifactStateCacheAccess, and all caches provided via CacheRepository are opened immediately. - Some tweaks to the cache display names.

- Use PersistentCache.createCache() to create the various task state caches. This way, the artifact caches and task state caches are all managed the same way. - Moved lock management from DefaultPersistentDirectoryStore to live with the rest of the lock management in DefaultCacheAccess.

GRADLE-1933 Tooling api thread safety.

Some of the stuff needs refactoring but I wanted to let it fly on the CI boxes to flush out potential problems. The commit touches the code in few places but that was necessary to make the integ test passing. Unfortunately, increasing the number of participating threads exposes some other issues so it's not the end of the concurrency story.

-Added more selective strategy on the ConnectorServices/GradleLauncher regarding reusing instances. Before, all services were singletons but that's not the strategy we can afford if we go concurrent. At the moment only ToolingApiLoader is a singleton. It is implemented quite naively but refactoring will follow. Also, there memory consumption needs reviewing.

-Enabled the integ test and added initial coverage for the outputs. They will be further improved to verify if concurrent builds / models are writing to the correct listeners. I've ran the test many times and it seems stable. The CI boxes will soon prove this statement true or false

-Some changes to the DefaultConnection: I create an instance of embeddedLogging per every build request (if we run in forking mode). Previously, it was shared and it contributed to the concurrency issues. It can be refactored slightly to make it more clear. Removed redundant static call injectCustomFactory (it is already a part of the code flow - see the constructor of DefaultGradleLauncherFactory).

Introduced TaskArtifactStateCacheAccess to isolate the various pieces of change detection from how the caches are constructed, and to provide synchronized access to the caches.

Moved creation of DefaultCacheAccess out of DefaultCacheLockingManager to behind PersistentCache, so it is reusable elsewhere.

Some renames.

Moved locking stuff from DefaultCacheLockingManager to UnitOfWorkCacheManager, where it is more reusable.

Moved handling of locking up from DefaultPersistentDirectoryCache to DefaultPersistentDirectoryStore.

- Added DirectoryCacheBuilder.withDisplayName() - Changed DefaultPersistentDirectoryCache to extend DefaultPersistentDirectoryStore.

Removed CacheFactory.CrossVersion enum. All cache implementations are dependent on current Gradle version.

Added LockMode.None, and allow lock mode to be specified via CacheRepository when opening the cache.


Merged ArtifactCacheMetaData into CacheLockingManager.

fixed GRADLE-1822: testng configuration failures resulting in skipped tests do not fail the build

introduced TestNGConfigurationListener

adapt above interface to either org.testng.IConfigurationListener2 or org.testng.internal.IConfigurationListener depending on which is on the class path