Details
-
Bug
-
Resolution: Fixed
-
High
-
6.1.3.2, 6.2.1
-
6.01
-
Description
GHConfiguration#getGrantedProjects uses a HashSet in a non thread-safe way. This can and has caused race conditions.
GHConfiguration.java
private Collection<Long> grantedProjects; ... public Collection<Long> getGrantedProjects() { if(grantedProjects != null) return grantedProjects; grantedProjects = new HashSet<Long>(); String projectIds = (String)getDataStorage().get(PROJECT_LIST); if(projectIds != null) { for(String id : projectIds.split(",")) { grantedProjects.add(Long.valueOf(id)); } } return grantedProjects; }
Solution is to add synchronized to the method manipulating the set.
Attachments
Issue Links
- duplicates
-
JSWSERVER-10781 GHConfiguration#getGrantedProjects not thread safe
- Closed