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

fix: exclude unnecessary modules in Caffeine #571

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

showuon
Copy link
Contributor

@showuon showuon commented Jul 17, 2024

In the released core zip, we included

  1. caffeine-3.1.8.jar
  2. checker-qual-3.37.0.jar
  3. error_prone_annotations-2.21.1.jar
    From this discussion in Caffeine project: Caffeine 2.7.0 extra dependencies ben-manes/caffeine#300 (comment) . The author of Caffeine project:

checker-qual And errorprone are annotations which Java doesn’t require at runtime unless you reflectively load them when inspecting the methods. Unfortunately other languages will not classload without them, making them required. You can exclude safely in Java.

Since we only use JAVA and it doesn't cause any errors while compiling after excluding them, I think we should remove them from the distribution zip.

@showuon showuon requested a review from a team as a code owner July 17, 2024 07:26
@jeqo
Copy link
Contributor

jeqo commented Jul 18, 2024

Thanks @showuon! Good finding, and agree it should help to make the distribution smaller and including only needed deps.
On the issue referenced, it's mentioned that Scala may not be happy if we remove these. The kafka broker root classes are still in Scala, however the plugin is loaded via Java classloading. I'm don't have much experience here to say if this is an issue or not. Could you elaborate on why this is not an issue? I guess as e2e tests are passing fine then it should be ok.
Also, the issue also references guava that is used by the google cloud sdk. I guess we could also consider removing those?

@showuon
Copy link
Contributor Author

showuon commented Jul 19, 2024

I'm don't have much experience here to say if this is an issue or not. Could you elaborate on why this is not an issue? I guess as e2e tests are passing fine then it should be ok.

TBH, I don't know much detail about it. But I agree with you that as long as the e2e tests passed, it means we don't need to ship these modules.

Also, the issue also references guava that is used by the google cloud sdk. I guess we could also consider removing those?

I agree. I just used the latest main to build gcs, it didn't include these packages. I think it's because we've excluded them from gcs here: #561

@jeqo
Copy link
Contributor

jeqo commented Jul 22, 2024

@showuon, yes that PR removed some, but in the issue comments, it references a few others:

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>28.0-jre</version>
            <exclusions>
                <exclusion>
                    <groupId>com.google.code.findbugs</groupId>
                    <artifactId>jsr305</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.checkerframework</groupId>
                    <artifactId>checker-qual</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.errorprone</groupId>
                    <artifactId>error_prone_annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.j2objc</groupId>
                    <artifactId>j2objc-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>animal-sniffer-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>listenablefuture</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

I think it should be safe to exclude them as well?

Comment on lines -23 to +28
exclude group: "com.google.errorprone"
exclude group: "org.checkerframework"
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
exclude group: 'org.checkerframework', module: 'checker-qual'
exclude group: 'com.google.code.findbugs', module: 'jsr305'
exclude group: 'com.google.j2objc', module: 'j2objc-annotations'
exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations'
exclude group: 'com.google.guava', module: 'listenablefuture'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Include module name to be more specific.

@showuon
Copy link
Contributor Author

showuon commented Jul 24, 2024

Good point @jeqo ! PR updated. Let's see if e2e tests can pass.

@showuon
Copy link
Contributor Author

showuon commented Jul 24, 2024

All tests passed!

Copy link
Contributor

@jeqo jeqo left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @showuon !

@jeqo jeqo merged commit 237b089 into Aiven-Open:main Jul 24, 2024
9 checks 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.

2 participants