You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[feat] Authentication implementations such as AuthenticationOAuth2 should support sharing thread pools or DNS cache #24795
I searched in the issues and found nothing similar.
Motivation
PIP-234 implementation #24790 adds support for sharing thread pools and DNS resolver/cache across multiple client instances. However, authentication implementations such as AuthenticationOAuth2 create new thread pools and DNS resolvers/caches. This isn't desired, since it would be useful to be able to share the Netty Event Loop and configure the DNS settings in the client and use them for all Pulsar client DNS lookups, at least for most common use cases.
Solution
The org.apache.pulsar.client.api.Authentication interface could be changed so that the "container" could pass a context instance with contains methods to lookup shared instances.
/** * Initialize the authentication provider. */defaultvoidstart(AuthenticationInitContextcontext) throwsPulsarClientException {
start();
}
/** * Initialize the authentication provider. */voidstart() throwsPulsarClientException;
The AuthenticationInitContext could contain generic "getService" and "getServiceByName" methods:
Hi @lhotari, I would like to work on this issue. I plan to start exploring a solution and would greatly appreciate any guidance or context you can provide. Thank you
Hi @lhotari, I would like to work on this issue. I plan to start exploring a solution and would greatly appreciate any guidance or context you can provide. Thank you
You can join the dev channel on Pulsar Slack to coordinate work. I might not be able to respond immediately, but I usually put effort to help if someone is putting effort to contribute.
Hi @lhotari, I would like to work on this issue. I plan to start exploring a solution and would greatly appreciate any guidance or context you can provide. Thank you
Hi @lhotari, I would like to work on this issue. I plan to start exploring a solution and would greatly appreciate any guidance or context you can provide. Thank you
Hi @lhotari, I would like to work on this issue. I plan to start exploring a solution and would greatly appreciate any guidance or context you can provide. Thank you
Hi, I’ve completed the work for this issue. I was busy for a while, so I hadn’t pushed it yet.
If it’s still useful, I can open a PR. Let me know if I should proceed or if the current assignee is already on it.
Hi, I’ve completed the work for this issue. I was busy for a while, so I hadn’t pushed it yet. If it’s still useful, I can open a PR. Let me know if I should proceed or if the current assignee is already on it.
@lhotari Thanks for the guidance. After reviewing the changes in #24944 , I see that parts of my implementation conflict with the updated OAuth2 structure. I’ll refactor my solution to align with the new code and then open the PR.
I’ve been running mock tests and Pulsar CI locally when validating changes. If there are additional checks or recommended steps I should follow, please let me know.
I’ve been running mock tests and Pulsar CI locally when validating changes. If there are additional checks or recommended steps I should follow, please let me know.
Thanks @lhotari for raising this. PIP-478 (#25890) added this, and #26282 implemented it: the client now hands authentication plugins its shared services, and AuthenticationOAuth2 gets its HTTP client from the client's framework factory. That client shares the owning PulsarClient/PulsarAdmin's event loop, timer and DNS resolver instead of creating its own. This is available since 5.0.0. If something is still missing, please reopen or open a new issue.
Activity
AradhyaSharma31 commentedon Oct 15, 2025
Hi @lhotari, I would like to work on this issue. I plan to start exploring a solution and would greatly appreciate any guidance or context you can provide. Thank you
lhotari commentedon Oct 15, 2025
@AradhyaSharma31 Thanks for volunteering. This might not be the best way to start contributing to Pulsar, but you can always give it a try. The Pulsar Contributor guide is available at https://pulsar.apache.org/contribute/ with multiple instructions. For example:
You can join the dev channel on Pulsar Slack to coordinate work. I might not be able to respond immediately, but I usually put effort to help if someone is putting effort to contribute.
3pacccccc commentedon Nov 26, 2025
Hi, are you still working on this issue?
lhotari commentedon Nov 26, 2025
@3pacccccc Not at the moment. btw. Please also review the comment in #24944 (comment) .
3pacccccc commentedon Nov 26, 2025
@lhotari OK, I see, I'll working on this.
AradhyaSharma31 commentedon Nov 28, 2025
Hi, I’ve completed the work for this issue. I was busy for a while, so I hadn’t pushed it yet.
If it’s still useful, I can open a PR. Let me know if I should proceed or if the current assignee is already on it.
lhotari commentedon Nov 28, 2025
@AradhyaSharma31 Sure, please go ahead and open a PR. It's recommended to run tests in your own fork as the first step for larger changes, please see https://pulsar.apache.org/contribute/personal-ci/. Please also check comments at #24944 (comment).
AradhyaSharma31 commentedon Nov 28, 2025
@lhotari Thanks for the guidance. After reviewing the changes in #24944 , I see that parts of my implementation conflict with the updated OAuth2 structure. I’ll refactor my solution to align with the new code and then open the PR.
I’ve been running mock tests and Pulsar CI locally when validating changes. If there are additional checks or recommended steps I should follow, please let me know.
lhotari commentedon Nov 28, 2025
@AradhyaSharma31 Please follow the instructions in https://pulsar.apache.org/contribute/personal-ci/ to first open a PR in your own fork and run the full Pulsar CI GitHub Actions pipeline there. It's not a very feasible solution to run the full pipeline locally since it requires about 10 hours of compute time to run all tests. You get this for free with GitHub Actions.
lhotari commentedon Mar 19, 2026
Slightly related to #19429
merlimat commentedon Oct 23, 2026
Thanks @lhotari for raising this. PIP-478 (#25890) added this, and #26282 implemented it: the client now hands authentication plugins its shared services, and AuthenticationOAuth2 gets its HTTP client from the client's framework factory. That client shares the owning PulsarClient/PulsarAdmin's event loop, timer and DNS resolver instead of creating its own. This is available since 5.0.0. If something is still missing, please reopen or open a new issue.