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

Exclude Non-Loadable Packages from ClassLoader. Fixes #issue 1385 #1384

Merged
merged 10 commits into from
Aug 28, 2024

Conversation

andreaspartisia
Copy link
Contributor

@andreaspartisia andreaspartisia commented Jul 4, 2024

Description

We encountered an issue with the package loader that loads every package indiscriminately, instead of using the Maven class loader's smart loading. This is a known problem, and while some packages have already been excluded, the process requires a merge request for each exclusion. Therefore, we identified the need for a faster and more dynamic exclusion mechanism.

This fix introduces a system property string containing a comma-separated list of packages to exclude. By setting this property, the specified packages will be excluded from the loaded packages.

Fixes #1385

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • Yes, there are changes in this PR that warrants bumping the Pulumi Service API version

@andreaspartisia andreaspartisia marked this pull request as ready for review July 4, 2024 11:51
@andreaspartisia andreaspartisia requested a review from a team as a code owner July 4, 2024 11:51
@andreaspartisia andreaspartisia marked this pull request as draft July 8, 2024 10:40
@andreaspartisia andreaspartisia marked this pull request as ready for review July 8, 2024 10:40
@andreaspartisia andreaspartisia changed the title Exclude Non-Loadable Packages from ClassLoader. Exclude Non-Loadable Packages from ClassLoader. #1385 Jul 8, 2024
@andreaspartisia andreaspartisia changed the title Exclude Non-Loadable Packages from ClassLoader. #1385 Exclude Non-Loadable Packages from ClassLoader. Fixes #issue 1385 Jul 8, 2024
Copy link
Member

@justinvp justinvp left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! I left some review comments. This also needs a test before we can merge it.

@andreaspartisia
Copy link
Contributor Author

Thanks for the review @justinvp

I have corrected it now and made a test for a the exclusion of packages.

Copy link
Member

@justinvp justinvp left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks!

@andreaspartisia, looks like there's a conflict with the pulumi submodule. Can you revert that change?

@andreaspartisia
Copy link
Contributor Author

Yes @justinvp it has been updated now.

@andreaspartisia
Copy link
Contributor Author

@justinvp
Do you have time to look at this again?

@justinvp
Copy link
Member

/run-acceptance-tests

@justinvp
Copy link
Member

@andreaspartisia, thanks for your patience!

I opened a temp PR to run the tests in CI and the new test is failing:

https://github.com/pulumi/pulumi-java/actions/runs/10464711824/job/28978759154?pr=1412#step:12:376

ResourcePackagesTest > ExcludedResource() FAILED
    java.lang.AssertionError: Test resource was found
        at com.pulumi.serialization.internal.ResourcePackagesTest.ExcludedResource(ResourcePackagesTest.java:91)

@andreaspartisia
Copy link
Contributor Author

Thanks for the reminder @justinvp
It was because all test used the same JVM in parallel testing, so they polluted each other, but I have made my test run in it's own JWM, so it's fine now.
I hope you have time to look at it again.

@andreaspartisia
Copy link
Contributor Author

@justinvp do you have time to look at it again or do one of your colleagues have time for it?

@justinvp
Copy link
Member

/run-acceptance-tests

Copy link
Member

@justinvp justinvp left a comment

Choose a reason for hiding this comment

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

LGTM! I'll get it merged after reviewing the test run.

Note: we were running into some unrelated lint issues in CI in this repo yesterday that we may need to fix separately, so it may be another day or so. Thanks for your patience and thanks again for addressing this!

@justinvp justinvp merged commit a1ab305 into pulumi:main Aug 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ClassLoader loads all packages presented in pom
2 participants