[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16352565#comment-16352565
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10269:
---------------------------------------------

DaanHoogland closed pull request #2444: CLOUDSTACK-10269: On deletion of role 
set name to null
URL: https://github.com/apache/cloudstack/pull/2444
 
 
   

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/server/src/org/apache/cloudstack/acl/RoleManagerImpl.java 
b/server/src/org/apache/cloudstack/acl/RoleManagerImpl.java
index 5b3998e8de8..5557aff71e0 100644
--- a/server/src/org/apache/cloudstack/acl/RoleManagerImpl.java
+++ b/server/src/org/apache/cloudstack/acl/RoleManagerImpl.java
@@ -18,7 +18,6 @@
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 
 import javax.inject.Inject;
@@ -172,7 +171,7 @@ public Boolean doInTransaction(TransactionStatus status) {
                     }
                     if (roleDao.remove(role.getId())) {
                         RoleVO roleVO = 
roleDao.findByIdIncludingRemoved(role.getId());
-                        roleVO.setName(role.getName() + "-deleted-" + new 
Date());
+                        roleVO.setName(null);
                         return roleDao.update(role.getId(), roleVO);
                     }
                     return false;


 

----------------------------------------------------------------
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:
us...@infra.apache.org


> Allow deletion of roles without causing concurrent exception
> ------------------------------------------------------------
>
>                 Key: CLOUDSTACK-10269
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10269
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>            Reporter: Rohit Yadav
>            Assignee: Rohit Yadav
>            Priority: Major
>             Fix For: Future, 4.11.1.1, 4.12.0.0
>
>
> Deletion of a role renames the role with a timestamp, when roles are 
> created/deleted aggresively it may cause concurrent exceptions. The fix is to 
> follow how other cloudstack entities are removed where name uniqueness need 
> to be honoured, i.e. by setting the field to null. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to