Details
-
Bug
-
Resolution: Obsolete
-
Major
-
JBossAS-4.0.0 Final, JBossAS-4.0.1 Final, JBossAS-4.0.1 SP1, JBossAS-4.0.2 Final, JBossAS-4.0.3 Final, JBossAS-4.0.3 SP1, JBossAS-4.0.4.GA, JBossAS-4.0.5.GA, JBossAS-4.2.0.GA, JBossAS-4.2.1.GA, JBossAS-4.2.2.GA, JBossAS-4.2.3.GA
-
None
-
Low
-
Workaround Exists
-
Description
pullNewDeployments method in FarmMemberService is not working correctly during startup where there are more than 1 nodes in the cluster. Currently newly started cluster will always pull the files from the coordinator node as the call to DeployedURL du = (DeployedURL)parentDUMap.get(depName); will always return null on startup.
Steps to reproduce:
1. create 2 or more nodes in 1 cluster
2. deploy app Test.war in the cluster
3. restart 1 of the nodes and you will see that this node is pulling the Test.war. Test.war hasn't changed therefore no need to pull it.
This is currently causing a lot of issues in our server as we have lots of apps ( over 100) deployed and are quite big in size , therefore pull all the files at startup causes the server to become available after a very long time.
Possible Fix;
@Override
protected void pullNewDeployments(HAPartition partition, HashMap farmed)
{
if(ServiceMBean.STARTING == getState()){
if(doInit)
}else
{ logger.info("using pullNewDeployments on FarmMemberService as we are not in starting state... " ); super.pullNewDeployments(partition, farmed); return; } Iterator it = farmed.keySet().iterator();
String parentName= null;
File destFile = null;
while (it.hasNext())
{
String depName = (String)it.next();
Date last = (Date)farmed.get(depName);
DeployedURL du = (DeployedURL)parentDUMap.get(depName);
int indexofParentName = depName.indexOf('/');
parentName= depName.substring(0, indexofParentName);
String child = depName.substring(indexofParentName+1, depName.length());
File parentFolder = findParent(parentName);
if(parentFolder == null)
destFile = new File(parentFolder,child);
Date localDeployedDate = new Date(destFile.lastModified());
logger.info("parentname=" + parentName + " destfile= " +destFile.getAbsolutePath() + " isexist=" + destFile.exists() + " local mode date=" + localDeployedDate + " remote deploy date=" + last);
if(destFile.exists() && !localDeployedDate.before(last))
else
{ logger.info(" going to pull " +depName + " from remote server....."); pullRemoteFile(new File(depName), parentName); }}
}
private void init() {
try{
HAPartition lHAPartition = null;
if (mClusterPartition != null)
if (lHAPartition == null)
{ // Old style config with PartitionName was used -- have to // look up the partition in JMX lHAPartition = (HAPartition) getServer().getAttribute( mClusterPartitionName, "HAPartition" ); } mFileTransfer = new ClusterFileTransfer(lHAPartition, buildParentFolderMapping());
logger.warn("Created mFileTransfer successfully");
}catch(Exception e)
}