You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/27 06:19:50 UTC
[GitHub] [pulsar] massakam commented on a change in pull request #10381: [Issue 10170] Optimize locks in AuthenticationAthenz
massakam commented on a change in pull request #10381:
URL: https://github.com/apache/pulsar/pull/10381#discussion_r620898217
##########
File path: pulsar-client-auth-athenz/src/main/java/org/apache/pulsar/client/impl/auth/AuthenticationAthenz.java
##########
@@ -81,23 +82,24 @@ public String getAuthMethodName() {
}
@Override
- synchronized public AuthenticationDataProvider getAuthData() throws PulsarClientException {
- if (cachedRoleTokenIsValid()) {
- return new AuthenticationDataAthenz(roleToken, isNotBlank(roleHeader) ? roleHeader : ZTSClient.getHeader());
- }
- try {
- // the following would set up the API call that requests tokens from the server
- // that can only be used if they are 10 minutes from expiration and last twenty
- // four hours
- RoleToken token;
- synchronized (providerDomainLock) {
- token = getZtsClient().getRoleToken(providerDomain, null, minValidity, maxValidity, false);
+ public AuthenticationDataProvider getAuthData() throws PulsarClientException {
+ synchronized (cachedRoleTokenLock) {
Review comment:
@merlimat That's right. Introduced read-write lock.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org