[
https://issues.apache.org/jira/browse/HADOOP-10678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14029943#comment-14029943
]
Chris Nauroth commented on HADOOP-10678:
----------------------------------------
Hi, [~benoyantony]. I think it's a safe change. I did some digging and traced
back to MAPREDUCE-2746 introducing the locking. It was meant to fix a problem
with {{ServiceLoader}} lazily loading the real {{securityInfoProviders}} and
not implementing its own thread-safety. It looks to me like the same pattern
was applied to {{testProviders}} for consistency, but it doesn't provide any
real benefit.
I see the same thing in {{SecurityUtil#getTokenInfo}}. Do you want to change
that one too?
> Unnecessary synchronization on collection used for only tests
> -------------------------------------------------------------
>
> Key: HADOOP-10678
> URL: https://issues.apache.org/jira/browse/HADOOP-10678
> Project: Hadoop Common
> Issue Type: Bug
> Components: security
> Reporter: Benoy Antony
> Assignee: Benoy Antony
> Priority: Minor
> Attachments: HADOOP-10678.patch
>
>
> The function _SecurityUtil.getKerberosInfo()_ is a function used during
> authentication and authorization.
> It has two synchronized blocks and one of them is on testProviders. This is
> an unnecessary lock given that the testProviders is empty in real scenario.
--
This message was sent by Atlassian JIRA
(v6.2#6252)