Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-6879

pullNewDeployments in FarmMemberService is buggy

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • No Release
    • 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
    • Clustering
    • None
    • Low
    • Workaround Exists
    • Hide

      Override pullNewDeployments as shown above in the description

      Show
      Override pullNewDeployments as shown above in the description

    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)

      { init(); doInit = false; }

      }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)

      { IllegalStateException stateException = new IllegalStateException("Can't find the farmed folder " + parentName); logger.error(stateException,stateException); throw stateException; }

      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))

      { logger.info(" no need to pull " + depName + " from remote server as the timestamps are same"); }

      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)

      { lHAPartition = mClusterPartition.getHAPartition(); }

      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)

      { logger.error("Error Starting ClusterMemberService ",e); }

      }

      Attachments

        Activity

          People

            bstansbe@redhat.com Brian Stansberry
            ozguy sachin mishra (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: