-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make AliasRegistry a singleton (#14002)
* Make AliasRegistry a singleton The current implementation of AliasRegistry will create an instance of the Alias Registry for each pipeline, which appears to potentially result in situations, such as in #13996, where multiple pipelines are simultaneously loading an alias registry from a yaml file in the jar file using getResourceAsStream, with the potential of the first thread closing the jar file underneath subsequent threads, leading to errors when reading the yaml file as the JarFile has been closed after the initial thread completed accessing. This commit changes the AliasRegistry to be a singleton, as is the PluginRegistry. Relates: #13996, #13666 * Update reflections library to 0.9.12 to avoid multi threading bug Earlier versions of the reflections library used in the plugin registry would use caches on JarUrlConnection, which when closed would also close the jar file for other resources using it, such as the AliasRegistry. This, combined with the fact that the AliasRegistry could be created simultaneously by many threads/pipelines could cause issues during AliasRegistry creation leading to failure to create a pipeline. * Avoid use of URLConnection caching when getting alias yaml resource * Use idiomatic ruby when accessing Java getInstance method Co-authored-by: Andrea Selva <[email protected]>
- Loading branch information
Showing
6 changed files
with
33 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters