[
https://issues.apache.org/jira/browse/KAFKA-4991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16341221#comment-16341221
]
ASF GitHub Bot commented on KAFKA-4991:
---------------------------------------
hachikuji closed pull request #4394: KAFKA-4991: Resolve findbugs warnings in
KerberosLogin
URL: https://github.com/apache/kafka/pull/4394
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/clients/src/main/java/org/apache/kafka/common/security/kerberos/KerberosLogin.java
b/clients/src/main/java/org/apache/kafka/common/security/kerberos/KerberosLogin.java
index b43d3b0c2f2..65c3b1cbe44 100644
---
a/clients/src/main/java/org/apache/kafka/common/security/kerberos/KerberosLogin.java
+++
b/clients/src/main/java/org/apache/kafka/common/security/kerberos/KerberosLogin.java
@@ -313,7 +313,7 @@ private long getRefreshTime(KerberosTicket tgt) {
return proposedRefresh;
}
- private synchronized KerberosTicket getTGT() {
+ private KerberosTicket getTGT() {
Set<KerberosTicket> tickets =
subject.getPrivateCredentials(KerberosTicket.class);
for (KerberosTicket ticket : tickets) {
KerberosPrincipal server = ticket.getServer();
@@ -340,7 +340,7 @@ private boolean hasSufficientTimeElapsed() {
* Re-login a principal. This method assumes that {@link #login()} has
happened already.
* @throws javax.security.auth.login.LoginException on a failure
*/
- private synchronized void reLogin() throws LoginException {
+ private void reLogin() throws LoginException {
if (!isKrbTicket) {
return;
}
diff --git a/gradle/findbugs-exclude.xml b/gradle/findbugs-exclude.xml
index 3bc3d39b339..66b7fb9562a 100644
--- a/gradle/findbugs-exclude.xml
+++ b/gradle/findbugs-exclude.xml
@@ -249,13 +249,6 @@ For a detailed description of findbugs bug categories, see
http://findbugs.sourc
<Bug pattern="JLM_JSR166_UTILCONCURRENT_MONITORENTER"/>
</Match>
- <Match>
- <!-- Suppress inconsistent synchronization warnings about
KerberosLogin#login.
- See KAFKA-4991 for details. -->
- <Class name="org.apache.kafka.common.security.kerberos.KerberosLogin"/>
- <Bug pattern="IS2_INCONSISTENT_SYNC"/>
- </Match>
-
<Match>
<!-- Suppress inconsistent synchronization warnings about
AbstractCoordinator#coordinator. See KAFKA-4992 for details.-->
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> KerberosLogin#login should probably be synchronized
> ---------------------------------------------------
>
> Key: KAFKA-4991
> URL: https://issues.apache.org/jira/browse/KAFKA-4991
> Project: Kafka
> Issue Type: Bug
> Reporter: Colin P. McCabe
> Assignee: Colin P. McCabe
> Priority: Major
> Labels: newbie
> Fix For: 1.1.0
>
>
> KerberosLogin#login should probably be synchronized, since it is modifying
> {{loginContext}} and {{lastLogin}}, which are normally only accessed under
> the lock.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)