You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2021/12/02 16:31:33 UTC
[GitHub] [accumulo] keith-turner commented on a change in pull request #2374: Cache the credentials because they are expensive to fetch
keith-turner commented on a change in pull request #2374:
URL: https://github.com/apache/accumulo/pull/2374#discussion_r761266670
##########
File path: server/base/src/main/java/org/apache/accumulo/server/ServerInfo.java
##########
@@ -176,7 +177,10 @@ public String getInstanceName() {
}
public Credentials getCredentials() {
- return SystemCredentials.get(getInstanceID(), getSiteConfiguration());
+ if (credentials == null) {
+ credentials = SystemCredentials.get(getInstanceID(), getSiteConfiguration());
Review comment:
This probably needs sync, volatile, or an AtomicReference to be thread safe.
This comment may be moot because of the other comment @ctubbsii made about moving this to the constructor which would make it thread safe.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org