bug 7295: seems like one agent attache is removed twice

status 7295: resolved fixed
This commit is contained in:
Anthony Xu 2010-11-22 20:45:59 -08:00
parent 7746257f79
commit d5b04dd25a
1 changed files with 5 additions and 2 deletions

View File

@ -759,11 +759,14 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory {
return;
}
long hostId = attache.getId();
if (s_logger.isDebugEnabled()) {
s_logger.debug("remove Agent : " + hostId);
}
AgentAttache removed = null;
boolean conflict = false;
synchronized (_agents) {
removed = _agents.remove(hostId);
if( removed != attache ){
removed = _agents.remove(hostId);
if( removed != null && removed != attache ){
conflict = true;
_agents.put(hostId, removed);
removed = attache;