Skip to content

[Bug] PulsarService.getLookupServiceAddress returns wrong port if TLS is enabled #21012

@alpreu

Description

@alpreu

Search before asking

  • I searched in the issues and found nothing similar.

Version

Pulsar 3.1.0 but also broken on master

Minimal reproduce step

  1. Start pulsar standalone with TLS configured using e.g. port 8081 for TLS
  2. Run pulsarAdmin.brokers().getActiveBrokers()

What did you expect to see?

The return value should be localhost:8081 (using TLS port)

What did you see instead?

The return value is localhost:8080 (not using TLS port)

Anything else?

The value is ultimately retrieved from PulsarService.getLookupServiceAddress.
I believe the code below should be the other way around, first checking if a TLS address is available and if not fall back to the non tls one:

https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java#L1740-L1743

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Labels

Staletype/bugThe PR fixed a bug or issue reported a bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions