Hi Kuhu Shukla
Sorry for replying late here.
Unless there are 2 refreshNodes done in parallel such that the first deactivateNodeTransition has not finished and the other refreshNodes is also trying to do the same transition
Since the transitions are happening under write lock, this may not happen.
I have one suggestion here.
I feel You could mark a node for GRACEFUL DECOMMISSION and ensure that node is in DECOMMISSIONING state. (can try to fire event to RMNodeImpl directly to do this). Later invoke refreshNodesGracefully and verify that an event named RECOMMISSION is raised to dispatcher or not. Similarly mark a node as DECOMMISSIONED and then invoke refreshNodesGracefully and verify the event RECOMMISSION is NOT raised. In second case, it will not enter for loop. but I feel this will clear cover our case here though its not direct.
Pls correct me if I am wrong.