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

[improve][misc] Remove the call to sun InetAddressCachePolicy #22329

Merged
merged 9 commits into from
Mar 27, 2024

Conversation

jianyun8023
Copy link
Contributor

@jianyun8023 jianyun8023 commented Mar 22, 2024

Main Issue: #20282

Motivation

I'm presently working with Spring Boot 3 and JDK 17. While utilizing Pulsar, I encountered an error indicating that reflection on content under the 'sun' package is restricted. After reviewing Pulsar-related issues, I found a suggestion to resolve this by using --add-opens java.base/sun.net=ALL-UNNAMED. However, this workaround isn't suitable and doesn't effectively address the issue. Hence, I've created this PR.

Modifications

The environment variables networkaddress.cache.ttl and networkaddress.cache.negative.ttl are standard configurations for obtaining related settings for security purposes.

I've made modifications to the org.apache.pulsar.common.util.netty.DnsResolverUtil method, eliminating its dependency on the sun.net.InetAddressCachePolicy class for obtaining DNS TTL. The sun.net.InetAddressCachePolicy class is currently removal.

java early_access jdk net-properties
oracle jdk8 net-properties

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Added customized ttl tests

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions bot added the doc-complete Your PR changes impact docs and the related docs have been already added. label Mar 22, 2024
Copy link
Member

@lhotari lhotari 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 added a review.

@lhotari lhotari changed the title Remove the call to sun InetAddressCachePolicy [improve][misc] Remove the call to sun InetAddressCachePolicy Mar 25, 2024
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM

@lhotari lhotari merged commit cce0b05 into apache:master Mar 27, 2024
49 of 50 checks passed
lhotari pushed a commit that referenced this pull request Mar 27, 2024
lhotari pushed a commit that referenced this pull request Mar 27, 2024
Technoboy- pushed a commit to Technoboy-/pulsar that referenced this pull request Apr 1, 2024
@lhotari
Copy link
Member

lhotari commented Apr 2, 2024

It was great that this change was made. It revealed a long time bug in the Dockerfile used in Pulsar 3.0.x, 3.1.x and 3.2.x versions. More explanation in comment #22400 (comment) .

mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 15, 2024
…#22329)

Co-authored-by: Lari Hotari <[email protected]>
(cherry picked from commit cce0b05)
(cherry picked from commit 1b9ae2e)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 17, 2024
…#22329)

Co-authored-by: Lari Hotari <[email protected]>
(cherry picked from commit cce0b05)
(cherry picked from commit 1b9ae2e)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 17, 2024
…#22329)

Co-authored-by: Lari Hotari <[email protected]>
(cherry picked from commit cce0b05)
(cherry picked from commit 1b9ae2e)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 19, 2024
…#22329)

Co-authored-by: Lari Hotari <[email protected]>
(cherry picked from commit cce0b05)
(cherry picked from commit 1b9ae2e)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 23, 2024
…#22329)

Co-authored-by: Lari Hotari <[email protected]>
(cherry picked from commit cce0b05)
(cherry picked from commit 1b9ae2e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants