Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLING-10339 temporarily explicitly initialize FSPackageRegistry #7

Conversation

stoerr
Copy link
Contributor

@stoerr stoerr commented Apr 28, 2021

This implements a workaround for https://issues.apache.org/jira/browse/JCRVLT-517 : it is possible that the FSPackageRegistry didn't initialize it's stateCache and the FSPackageRegistry.contains() method, which us used from ExecutionBuilderImpl, doesn't initialize it's cache either - thus dependencies of packages aren't found and the execution plan fails.

The call to FSPackageRegistry.packages() forces the initialization of the stateCache of the registry, and now it works. Thus this can be used with Jackrabbit Vault 3.4.10 as well.

The test failed since the FSPackageRegistry didn't have a home directory set. I just replaced it with a mock, since, as far as I can tell, none of it's funktionality is actually used in the test.

@@ -132,6 +132,8 @@ public void processRepository(SlingRepository slingRepository) throws Exception
logger.info("Waiting for PackageRegistry.");
PackageRegistry registry = (PackageRegistry) st.waitForService(0);
logger.info("PackageRegistry found - starting execution of execution plan");
// workaround until https://issues.apache.org/jira/browse/JCRVLT-517 is solved: registry.contains yields wrong value until initialized
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a hint, where registry.contains() is called as this doesn't happen in this class...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the code comment? OK, done.

@stoerr stoerr force-pushed the feature/SLING-10339-workaround-execution-plan-failure branch from b0a25cf to 43ad6fc Compare April 29, 2021 07:50
@sonarcloud
Copy link

sonarcloud bot commented Apr 29, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@kwin kwin merged commit dd2685b into apache:master Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants