You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/02/12 19:57:00 UTC

[jira] [Work logged] (KNOX-2233) DefaultKeystoreService getCredentialForCluster uses cache without synchronization

     [ https://issues.apache.org/jira/browse/KNOX-2233?focusedWorklogId=386180&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-386180 ]

ASF GitHub Bot logged work on KNOX-2233:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Feb/20 19:56
            Start Date: 12/Feb/20 19:56
    Worklog Time Spent: 10m 
      Work Description: pzampino commented on pull request #264: KNOX-2233 - DefaultKeystoreService getCredentialForCluster uses cache…
URL: https://github.com/apache/knox/pull/264
 
 
   … without synchronization
   
   ## What changes were proposed in this pull request?
   
   Added synchronization to getCredentialForCluster(String, String) since it uses/updates the cache (e.g., checkCache(String, String), addToCache(String, String, String)). At a minimum, this avoids potential repeated unnecessary keystore file accesses for the same alias.
   
   ## How was this patch tested?
   Performed some manual testing, but since the overall behavior should not change, ran all existing tests as validation.
   
 
----------------------------------------------------------------
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


Issue Time Tracking
-------------------

            Worklog Id:     (was: 386180)
    Remaining Estimate: 0h
            Time Spent: 10m

> DefaultKeystoreService getCredentialForCluster uses cache without synchronization
> ---------------------------------------------------------------------------------
>
>                 Key: KNOX-2233
>                 URL: https://issues.apache.org/jira/browse/KNOX-2233
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 1.4.0
>            Reporter: Philip Zampino
>            Assignee: Philip Zampino
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The getCredentialForCluster(String, String) method of DefaultKeystoreService invokes checkCache(String, String) and addToCache(String, String) without any synchronization, despite the comments on those methods indicating that they are only called within critical sections of other methods. This method should be synchronized similar to what is done for the addCredentialForCluster(String, String, String) and removeCredentialForCluster(String, String) method implementations therein.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)