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] [admin] Fix lookup get a null result if uses proxy #23556

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

poorbarcode
Copy link
Contributor

Motivation

If the user deploys a cluster with proxy, and network topology like this: Client -> Proxy(with TLS) -> Broker(without TLS)

When the user calls pulsar-admin topics lookup <topic name>, the user will get a null response.

But the exact value that the broker responded to is below:

{
	"brokerUrl": "pulsar://broker-1.com:6650",
	"httpUrl": "http://broker-1.com:8080",
	"brokerUrlSsl": ""
}

It is caused by the pulsar-admin client's issue: https://github.com/apache/pulsar/blob/master/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/LookupImpl.java#L60

if (client.useTls) {
  return response.brokerUrlSsl; // even if it is null 
}

Modifications

  • fix the issue
  • the test is hard to write, so I skipped to write a test

Documentation

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

Matching PR in forked repository

PR in forked repository: x

@Technoboy- Technoboy- added this to the 4.1.0 milestone Nov 5, 2024
@Technoboy- Technoboy- closed this Nov 5, 2024
@Technoboy- Technoboy- reopened this Nov 5, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 74.31%. Comparing base (bbc6224) to head (e6df03d).
Report is 710 commits behind head on master.

Files with missing lines Patch % Lines
...pache/pulsar/client/admin/internal/LookupImpl.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23556      +/-   ##
============================================
+ Coverage     73.57%   74.31%   +0.74%     
- Complexity    32624    34424    +1800     
============================================
  Files          1877     1943      +66     
  Lines        139502   147051    +7549     
  Branches      15299    16209     +910     
============================================
+ Hits         102638   109288    +6650     
- Misses        28908    29330     +422     
- Partials       7956     8433     +477     
Flag Coverage Δ
inttests 27.37% <0.00%> (+2.79%) ⬆️
systests 24.31% <0.00%> (-0.01%) ⬇️
unittests 73.70% <50.00%> (+0.85%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...pache/pulsar/client/admin/internal/LookupImpl.java 73.91% <50.00%> (-1.65%) ⬇️

... and 652 files with indirect coverage changes

@poorbarcode poorbarcode merged commit c53a85e into apache:master Nov 5, 2024
73 of 76 checks passed
@poorbarcode poorbarcode deleted the fix/lookup_get_null_result branch November 5, 2024 08:37
poorbarcode added a commit that referenced this pull request Nov 5, 2024
poorbarcode added a commit that referenced this pull request Nov 5, 2024
poorbarcode added a commit that referenced this pull request Nov 5, 2024
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 5, 2024
(cherry picked from commit c53a85e)
(cherry picked from commit 2b98d2d)
visxu pushed a commit to vissxu/pulsar that referenced this pull request Nov 6, 2024
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Nov 6, 2024
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.

5 participants