continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1148725 - in /continuum/trunk: continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ continuum-bui...
Date Wed, 20 Jul 2011 12:29:51 GMT
Author: ctan
Date: Wed Jul 20 12:29:49 2011
New Revision: 1148725

URL: http://svn.apache.org/viewvc?rev=1148725&view=rev
Log:
[CONTINUUM-2638] improve logs for debugging purposes when distributed builds is enabled

Modified:
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CleanWorkingDirectoryAction.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java?rev=1148725&r1=1148724&r2=1148725&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java Wed Jul 20 12:29:49 2011
@@ -23,7 +23,6 @@ import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
@@ -52,17 +51,10 @@ import org.apache.maven.continuum.model.
 import org.apache.maven.continuum.model.scm.ScmResult;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.release.ContinuumReleaseException;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.shared.release.ReleaseResult;
-import org.apache.maven.shared.release.versions.DefaultVersionInfo;
-import org.apache.maven.shared.release.versions.VersionInfo;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
 import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -113,6 +105,7 @@ public class ContinuumBuildAgentServiceI
 
         try
         {
+            log.debug( "Adding project group {} to prepare build queue", task.getProjectGroupId() );
             buildAgentTaskQueueManager.getPrepareBuildQueue().put( task );
         }
         catch ( TaskQueueException e )
@@ -178,12 +171,15 @@ public class ContinuumBuildAgentServiceI
     public Map<String, Object> getBuildResult( int projectId )
         throws ContinuumBuildAgentException
     {
+        log.debug( "Get build result of project {}", projectId );
+
         Map<String, Object> result = new HashMap<String, Object>();
 
         int currentBuildId = 0;
 
         try
         {
+            log.debug( "Get current build project" );
             currentBuildId = buildAgentTaskQueueManager.getIdOfProjectCurrentlyBuilding();
         }
         catch ( TaskQueueManagerException e )
@@ -191,6 +187,7 @@ public class ContinuumBuildAgentServiceI
             throw new ContinuumBuildAgentException( e.getMessage(), e );
         }
 
+        log.debug( "Check if project {} is the one currently building in the agent", projectId );
         if ( projectId == currentBuildId )
         {
             BuildContext buildContext = buildContextManager.getBuildContext( projectId );
@@ -249,6 +246,10 @@ public class ContinuumBuildAgentServiceI
             result.put( ContinuumBuildAgentUtil.KEY_SCM_RESULT,
                         ContinuumBuildAgentUtil.createScmResult( buildContext ) );
         }
+        else
+        {
+            log.debug( "Unable to get build result because project {} is not currently building in the agent", projectId );
+        }
         return result;
     }
 
@@ -257,6 +258,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Cancelling current build" );
             buildAgentTaskQueueManager.cancelBuild();
         }
         catch ( TaskQueueManagerException e )
@@ -318,6 +320,7 @@ public class ContinuumBuildAgentServiceI
 
         try
         {
+            log.debug( "Getting release plugin parameters of project {}", projectId );
             return ReleaseUtil.getReleasePluginParameters( workingDirectory, pomFilename );
         }
         catch ( Exception e )
@@ -351,6 +354,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Preparing release" );
             return buildAgentReleaseManager.releasePrepare( project, properties, releaseVersion, developmentVersion,
                                                             environments, username );
         }
@@ -363,6 +367,7 @@ public class ContinuumBuildAgentServiceI
     public Map<String, Object> getReleaseResult( String releaseId )
         throws ContinuumBuildAgentException
     {
+        log.debug( "Getting release result of release {}", releaseId );
         ReleaseResult result = buildAgentReleaseManager.getReleaseResult( releaseId );
 
         Map<String, Object> map = new HashMap<String, Object>();
@@ -396,6 +401,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Performing release" );
             buildAgentReleaseManager.releasePerform( releaseId, goals, arguments, useReleaseProfile, repository, username );
         }
         catch ( ContinuumReleaseException e )
@@ -411,6 +417,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Performing release from scm" );
             return buildAgentReleaseManager.releasePerformFromScm( goals, arguments, useReleaseProfile, repository,
                                                                    scmUrl, scmUsername, scmPassword, scmTag, scmTagBase,
                                                                    environments, username );
@@ -424,6 +431,7 @@ public class ContinuumBuildAgentServiceI
     public String releaseCleanup( String releaseId )
         throws ContinuumBuildAgentException
     {
+        log.debug( "Cleanup release {}", releaseId );
         return buildAgentReleaseManager.releaseCleanup( releaseId );
     }
 
@@ -432,6 +440,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Release rollback release {} with project {}", releaseId, projectId );
             buildAgentReleaseManager.releaseRollback( releaseId, projectId );
         }
         catch ( ContinuumReleaseException e )
@@ -446,6 +455,8 @@ public class ContinuumBuildAgentServiceI
         
         try
         {
+            log.debug( "Getting number of projects in any queue" );
+
             if ( buildAgentTaskQueueManager.getCurrentProjectInBuilding() != null )
             {
                 size++;
@@ -473,6 +484,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Getting projects in prepare build queue" );
             List<Map<String, Object>> projects = new ArrayList<Map<String, Object>>();
 
             for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
@@ -501,6 +513,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Getting projects in prepare build queue" );
             List<Map<String, Object>> projects = new ArrayList<Map<String, Object>>();
 
             for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
@@ -530,6 +543,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Getting projects in build queue" );
             List<Map<String, Object>> projects = new ArrayList<Map<String, Object>>();
 
             for ( BuildProjectTask task : buildAgentTaskQueueManager.getProjectsInBuildQueue() )
@@ -559,6 +573,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Get project currently preparing build" );
             Map<String, Object> project = new HashMap<String, Object>();
 
             PrepareBuildProjectsTask task = buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();
@@ -586,6 +601,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Getting projects currently preparing build" );
             List<Map<String, Object>> projects = new ArrayList<Map<String, Object>>();
 
             PrepareBuildProjectsTask task = buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();
@@ -616,6 +632,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Getting currently building project" );
             Map<String, Object> project = new HashMap<String, Object>();
 
             BuildProjectTask task = buildAgentTaskQueueManager.getCurrentProjectInBuilding();
@@ -643,6 +660,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Checking if project group is in any queue", projectGroupId );
             for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
             {
                 if ( task.getProjectGroupId() == projectGroupId )
@@ -689,6 +707,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Checking if projects {} is in any queue", projectIds );
             PrepareBuildProjectsTask currentPrepareBuildTask = buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();
 
             if ( currentPrepareBuildTask != null && currentPrepareBuildTask.getScmRootId() == projectScmRootId )
@@ -744,6 +763,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Checking if project group {} is in prepare build queue", projectGroupId );
             for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
             {
                 if ( task.getProjectGroupId() == projectGroupId )
@@ -764,6 +784,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Checking if project group {} currently preparing build", projectGroupId );
             PrepareBuildProjectsTask currentPrepareBuildTask = buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();
 
             if ( currentPrepareBuildTask != null && currentPrepareBuildTask.getProjectGroupId() == projectGroupId )
@@ -783,6 +804,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Checking if project {} is currently building", projectId );
             BuildProjectTask currentBuildTask = buildAgentTaskQueueManager.getCurrentProjectInBuilding();
 
             if ( currentBuildTask != null && currentBuildTask.getProjectId() == projectId )
@@ -802,6 +824,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Checking if project {} is in build queue", projectId );
             List<BuildProjectTask> buildTasks = buildAgentTaskQueueManager.getProjectsInBuildQueue();
 
             if ( buildTasks != null )
@@ -828,6 +851,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Removing project group {} from prepare build queue", projectGroupId );
             return buildAgentTaskQueueManager.removeFromPrepareBuildQueue( projectGroupId, scmRootId );
         }
         catch ( TaskQueueManagerException e )
@@ -842,6 +866,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Removing project groups {} from prepare build queue", hashCodes );
             buildAgentTaskQueueManager.removeFromPrepareBuildQueue( listToIntArray( hashCodes ) );
         }
         catch ( TaskQueueManagerException e )
@@ -856,6 +881,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Removing project {} with buildDefinition {} from build queue", projectId, buildDefinitionId );
             return buildAgentTaskQueueManager.removeFromBuildQueue( projectId, buildDefinitionId );
         }
         catch ( TaskQueueManagerException e )
@@ -870,6 +896,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Removing projects {} from build queue", hashCodes );
             buildAgentTaskQueueManager.removeFromBuildQueue( listToIntArray( hashCodes ) );
         }
         catch ( TaskQueueManagerException e )
@@ -881,7 +908,7 @@ public class ContinuumBuildAgentServiceI
 
     public boolean ping()
     {
-        log.info( "Ping Ok" );
+        log.debug( "Ping Ok" );
 
         return Boolean.TRUE;
     }
@@ -891,6 +918,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
+            log.debug( "Getting build agent platform" );
             return System.getProperty( "os.name" );
         }
         catch ( Exception e )

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CleanWorkingDirectoryAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CleanWorkingDirectoryAction.java?rev=1148725&r1=1148724&r2=1148725&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CleanWorkingDirectoryAction.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CleanWorkingDirectoryAction.java Wed Jul 20 12:29:49 2011
@@ -49,6 +49,8 @@ public class CleanWorkingDirectoryAction
     
         if ( workingDirectory.exists() )
         {
+            getLogger().debug( "Cleaning working directory " + workingDirectory.getAbsolutePath() );
+
             FileSetManager fileSetManager = new FileSetManager();
             FileSet fileSet = new FileSet();
             fileSet.setDirectory( workingDirectory.getPath() );

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java?rev=1148725&r1=1148724&r2=1148725&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java Wed Jul 20 12:29:49 2011
@@ -96,6 +96,7 @@ public class ExecuteBuilderAction
         {
             File buildOutputFile = buildAgentConfigurationService.getBuildOutputFile( project.getId() );
 
+            getLogger().debug( "Start building of project " + project.getId() );
             ContinuumAgentBuildExecutionResult result = buildExecutor.build( project, buildDefinition, buildOutputFile,
                                                                              environments, localRepository );
 

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java?rev=1148725&r1=1148724&r2=1148725&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java Wed Jul 20 12:29:49 2011
@@ -393,6 +393,7 @@ public abstract class AbstractBuildExecu
 
         try
         {
+            log.debug( "Update project {}" + project.getId() );
             buildAgentManager.updateProject( projectMap );
         }
         catch ( Exception e )

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java?rev=1148725&r1=1148724&r2=1148725&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java Wed Jul 20 12:29:49 2011
@@ -103,6 +103,7 @@ public class DefaultBuildAgentConfigurat
                 this.generalBuildAgentConfiguration.setWorkingDirectory(
                     new File( configuration.getWorkingDirectory() ) );
             }
+
             this.generalBuildAgentConfiguration.setContinuumServerUrl( configuration.getContinuumServerUrl() );
             this.generalBuildAgentConfiguration.setInstallations( configuration.getInstallations() );
             this.generalBuildAgentConfiguration.setLocalRepositories( configuration.getLocalRepositories() );

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java?rev=1148725&r1=1148724&r2=1148725&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java Wed Jul 20 12:29:49 2011
@@ -99,7 +99,7 @@ public class DefaultBuildAgentReleaseMan
         }
         catch ( ContinuumReleaseException e )
         {
-            log.error( "Error while preparing release" );
+            log.error( "Error while preparing release", e );
             throw e;
         }
     }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java?rev=1148725&r1=1148724&r2=1148725&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java Wed Jul 20 12:29:49 2011
@@ -107,7 +107,7 @@ public class BuildProjectTaskExecutor
 
         try
         {
-            log.info( "Initializing build (projectId=" + projectId + ")" );
+            log.info( "Initializing build (projectId={})", projectId );
             BuildContext context = buildContextManager.getBuildContext( projectId );
             initializeBuildContext( context );
     
@@ -116,13 +116,13 @@ public class BuildProjectTaskExecutor
                 return;
             }
     
-            log.info( "Checking if project '" + context.getProjectName() + "' should build" );
+            log.info( "Checking if project '{}' should build", context.getProjectName() );
             if ( !shouldBuild( context ) )
             {
                 return;
             }
     
-            log.info( "Starting build of " + context.getProjectName() );
+            log.info( "Starting build of {}", context.getProjectName() );
             startBuild( context );
     
             try
@@ -141,10 +141,12 @@ public class BuildProjectTaskExecutor
     
                 performAction( "execute-agent-builder", context );
     
+                log.info( "Updating build result of project '{}'", context.getProjectName() );
                 updateBuildResult( context, null );
             }
             finally
             {
+                log.info( "End build of project '{}'", context.getProjectName() );
                 endBuild( context );
             }
         }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java?rev=1148725&r1=1148724&r2=1148725&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java Wed Jul 20 12:29:49 2011
@@ -87,13 +87,13 @@ public class PrepareBuildProjectsTaskExe
                     {
                         BuildDefinition buildDef = BuildContextToBuildDefinition.getBuildDefinition( buildContext );
     
-                        log.info( "Check scm root state" );
+                        log.debug( "Check scm root state of project group '{}'",  buildContext.getProjectGroupName() );
                         if ( !checkProjectScmRoot( context ) )
                         {
                             break;
                         }
     
-                        log.info( "Starting prepare build" );
+                        log.info( "Starting prepare build of project group '{}'", buildContext.getProjectGroupName() );
                         startPrepareBuild( buildContext );
     
                         log.info( "Initializing prepare build" );
@@ -103,17 +103,17 @@ public class PrepareBuildProjectsTaskExe
                         {
                             if ( buildDef.isBuildFresh() )
                             {
-                                log.info( "Clean up working directory" );
+                                log.info( "Clean up working directory of project '{}'", buildContext.getProjectName() );
                                 cleanWorkingDirectory( buildContext );
                             }
     
-                            log.info( "Updating working directory" );
+                            log.info( "Updating working directory of project '{}'", buildContext.getProjectName() );
                             updateWorkingDirectory( buildContext );
     
-                            log.info( "Merging SCM results" );
                             //CONTINUUM-1393
                             if ( !buildDef.isBuildFresh() )
                             {
+                                log.info( "Merging SCM results of project '{}'", buildContext.getProjectName() );
                                 mergeScmResults( buildContext );
                             }
                         }
@@ -131,6 +131,7 @@ public class PrepareBuildProjectsTaskExe
     
                 if ( checkProjectScmRoot( context ) )
                 {
+                    log.debug( "Successful prepare build. Creating build task" );
                     buildProjects( buildContexts );
                 }
             }
@@ -253,6 +254,8 @@ public class PrepareBuildProjectsTaskExe
 
         ScmResult scmResult = ContinuumBuildAgentUtil.getScmResult( context, null );
 
+        log.debug( "End prepare build of project '{}'", buildContext.getProjectName() );
+
         if ( scmResult == null || !scmResult.isSuccess() )
         {
             context.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_STATE, ContinuumProjectState.ERROR );
@@ -296,6 +299,7 @@ public class PrepareBuildProjectsTaskExe
 
             try
             {
+                log.debug( "End prepare build of project group '{}'", ContinuumBuildAgentUtil.getProjectGroupName( context ) );
                 buildAgentManager.endPrepareBuild( result );
             }
             catch ( ContinuumException e )

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java?rev=1148725&r1=1148724&r2=1148725&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java Wed Jul 20 12:29:49 2011
@@ -95,6 +95,7 @@ public class DefaultBuildAgentTaskQueueM
         {
             if ( task instanceof BuildProjectTask )
             {
+                log.debug( "Current project building: {}", ( (BuildProjectTask) task ).getProjectName() );
                 return ( (BuildProjectTask) task ).getProjectId();
             }
         }
@@ -119,7 +120,7 @@ public class DefaultBuildAgentTaskQueueM
                 {
                     if ( task != null )
                     {
-                        log.info( "remove project '" + task.getProjectName() + "' from build queue" );
+                        log.info( "remove project '{}' from build queue", task.getProjectName() );
                         buildAgentBuildQueue.remove( task );
                     }
                 }
@@ -191,7 +192,7 @@ public class DefaultBuildAgentTaskQueueM
                 {
                     if ( task != null && task.getProjectId() == projectId )
                     {
-                        log.info( "project already in build queue" );
+                        log.debug( "project {} is in build queue", task.getProjectName() );
                         return true;
                     }
                 }
@@ -224,7 +225,7 @@ public class DefaultBuildAgentTaskQueueM
                              task.getBuildTrigger().getTrigger() == buildTrigger.getTrigger() &&
                              task.getScmRootAddress().equals( scmRootAddress ) )
                     {
-                        log.info( "projects already in build queue" );
+                        log.info( "project group {} in prepare build queue", task.getProjectGroupId() );
                         return true;
                     }
                 }
@@ -277,6 +278,7 @@ public class DefaultBuildAgentTaskQueueM
 
         if ( task != null )
         {
+            log.debug( "Current project group preparing build: {}", ( (PrepareBuildProjectsTask) task ).getProjectGroupId() );
             return (PrepareBuildProjectsTask) task;
         }
         return null;
@@ -289,6 +291,7 @@ public class DefaultBuildAgentTaskQueueM
 
         if ( task != null )
         {
+            log.debug( "Current project building: {}", ( (BuildProjectTask) task).getProjectName() );
             return (BuildProjectTask) task;
         }
 
@@ -306,6 +309,7 @@ public class DefaultBuildAgentTaskQueueM
             {
                 if ( task != null && task.getProjectGroupId() == projectGroupId && task.getScmRootId() == scmRootId )
                 {
+                    log.debug( "Remove project group {} from prepare build queue", projectGroupId );
                     return getPrepareBuildQueue().remove( task );
                 }
             }
@@ -325,6 +329,7 @@ public class DefaultBuildAgentTaskQueueM
             {
                 if ( task != null && ArrayUtils.contains( hashCodes, task.getHashCode() ) )
                 {
+                    log.debug( "Remove project group '{}' from prepare build queue", task.getProjectGroupId() );
                     getPrepareBuildQueue().remove( task );
                 }
             }
@@ -342,6 +347,7 @@ public class DefaultBuildAgentTaskQueueM
             {
                 if ( task != null && task.getProjectId() == projectId && task.getBuildDefinitionId() == buildDefinitionId )
                 {
+                    log.debug( "Remove project {} with buildDefinition{} from build queue", task.getProjectName(), task.getBuildDefinitionId() );
                     return getBuildQueue().remove( task );
                 }
             }
@@ -361,6 +367,7 @@ public class DefaultBuildAgentTaskQueueM
             {
                 if ( task != null && ArrayUtils.contains( hashCodes, task.getHashCode() ) )
                 {
+                    log.debug( "Remove project '{}' from build queue", task.getProjectName() );
                     getBuildQueue().remove( task );
                 }
             }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java?rev=1148725&r1=1148724&r2=1148725&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java Wed Jul 20 12:29:49 2011
@@ -137,19 +137,19 @@ public class DefaultDistributedBuildMana
 
                             if ( client.ping() )
                             {
-                                log.info(
-                                    "agent is enabled, create distributed build queue for build agent '" + agent.getUrl() + "'" );
+                                log.debug(
+                                    "agent is enabled, create distributed build queue for build agent '{}'", agent.getUrl() );
                                 createDistributedBuildQueueForAgent( agent.getUrl() );
                             }
                             else
                             {
-                                log.info( "unable to ping build agent '" + agent.getUrl() + "'" );
+                                log.debug( "unable to ping build agent '{}'", agent.getUrl() );
                             }
                         }
                         catch ( MalformedURLException e )
                         {
                             // do not throw exception, just log it
-                            log.info( "Invalid build agent URL " + agent.getUrl() + ", not creating distributed build queue" );
+                            log.error( "Invalid build agent URL {}, not creating distributed build queue", agent.getUrl() );
                         }
                         catch ( ContinuumException e )
                         {
@@ -159,10 +159,14 @@ public class DefaultDistributedBuildMana
                         catch ( Exception e )
                         {
                             agent.setEnabled( false );
-                            log.info( "unable to ping build agent '" + agent.getUrl() + "': " +
+                            log.debug( "unable to ping build agent '{}' : {}", agent.getUrl(),
                                 ContinuumUtils.throwableToString( e ) );
                         }
                     }
+                    else
+                    {
+                        log.debug( "agent {} is disabled, not creating distributed build queue", agent.getUrl() );
+                    }
                 }
             }
         }
@@ -190,35 +194,36 @@ public class DefaultDistributedBuildMana
     
                         if ( client.ping() )
                         {
-                            log.info( "agent is enabled, create distributed build queue for build agent '" + agent.getUrl() + "'" );
+                            log.debug( "agent is enabled, create distributed build queue for build agent '{}'", agent.getUrl() );
                             createDistributedBuildQueueForAgent( agent.getUrl() );
                         }
                         else
                         {
-                            log.info( "unable to ping build agent '" + agent.getUrl() + "'" );
+                            log.debug( "unable to ping build agent '{}'", agent.getUrl() );
                         }
                     }
                     catch ( MalformedURLException e )
                     {
                         // do not throw exception, just log it
-                        log.info( "Invalid build agent URL " + agent.getUrl() + ", not creating distributed build queue" );
+                        log.error( "Invalid build agent URL {}, not creating distributed build queue", agent.getUrl() );
                     }
                     catch ( Exception e )
                     {
                         agent.setEnabled( false );
-                        log.info( "unable to ping build agent '" + agent.getUrl() + "': " +
+                        log.debug( "unable to ping build agent '{}': {}", agent.getUrl(),
                             ContinuumUtils.throwableToString( e ) );
                     }
                 }
                 else if ( !agent.isEnabled() && overallDistributedBuildQueues.containsKey( agent.getUrl() ) )
                 {
-                    log.info( "agent is disabled, remove distributed build queue for build agent '" + agent.getUrl() + "'" );
+                    log.debug( "agent is disabled, remove distributed build queue for build agent '{}'", agent.getUrl() );
                     removeDistributedBuildQueueOfAgent( agent.getUrl() );
                 }
             }
         }
     }
 
+    @SuppressWarnings( "unused" )
     public void prepareBuildProjects( Map<Integer, Integer>projectsBuildDefinitionsMap, BuildTrigger buildTrigger, int projectGroupId, 
                                       String projectGroupName, String scmRootAddress, int scmRootId, List<ProjectScmRoot> scmRoots )
         throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
@@ -227,12 +232,18 @@ public class DefaultDistributedBuildMana
                                                                       projectGroupId, projectGroupName, 
                                                                       scmRootAddress, scmRootId );
 
-        OverallDistributedBuildQueue overallDistributedBuildQueue = getOverallDistributedBuildQueueByGroup( projectGroupId, scmRoots, scmRootId );
+    	log.debug( "Determining which build agent should build the project..." );
+
+    	OverallDistributedBuildQueue overallDistributedBuildQueue = getOverallDistributedBuildQueueByGroup( projectGroupId, scmRoots, scmRootId );
 
         if ( overallDistributedBuildQueue == null )
         {
+            log.debug( "No projects with the same continuum group is currently building, checking if build definition has an attached build agent group" );
+
             if ( hasBuildagentGroup( projectsBuildDefinitionsMap ) )
             {
+                log.debug( "Build definition used has an attached build agent group, checking if there are configured build agents in the group" );
+
                 if ( !hasBuildagentInGroup( projectsBuildDefinitionsMap ) )
                 {
                     log.warn( "No build agent configured in build agent group. Not building projects." );
@@ -242,15 +253,18 @@ public class DefaultDistributedBuildMana
                 else
                 {
                     // get overall distributed build queue from build agent group
-                    log.info( "getting the least busy build agent from the build agent group" );
+                    log.info( "Getting the least busy build agent from the build agent group" );
                     overallDistributedBuildQueue = getOverallDistributedBuildQueueByAgentGroup( projectsBuildDefinitionsMap );
+                    log.debug( "Building project in the least busy agent {} within the build agent group", 
+                               overallDistributedBuildQueue.getBuildAgentUrl() );
                 }
             }
             else
             {
                 // project does not have build agent group
-                log.info( "project does not have a build agent group, getting the least busy build agent" );
+                log.info( "Project does not have a build agent group, getting the least busy build agent" );
                 overallDistributedBuildQueue = getOverallDistributedBuildQueue();
+                log.debug( "Building project in the least busy agent {}", overallDistributedBuildQueue.getBuildAgentUrl() );
             }
         }
 
@@ -268,7 +282,7 @@ public class DefaultDistributedBuildMana
         }
         else
         {
-            log.warn( "No build agent configured. Not building projects." );
+            log.warn( "Unable to determine which build agent should build the project. No build agent configured. Not building projects." );
 
             throw new NoBuildAgentException( "No build agent configured" );
         }
@@ -306,21 +320,21 @@ public class DefaultDistributedBuildMana
 
                     overallDistributedBuildQueues.remove( buildAgentUrl );
 
-                    log.info( "remove distributed build queue for build agent '" + buildAgentUrl + "'" );
+                    log.debug( "remove distributed build queue for build agent '{}'", buildAgentUrl );
                 }
                 catch ( TaskQueueException e )
                 {
-                    log.error( "Error occurred while removing build agent " + buildAgentUrl, e );
+                    log.error( "Error occurred while removing build agent {}", buildAgentUrl, e );
                     throw new ContinuumException( "Error occurred while removing build agent " + buildAgentUrl, e );
                 }
                 catch ( ComponentLifecycleException e )
                 {
-                    log.error( "Error occurred while removing build agent " + buildAgentUrl, e );
+                    log.error( "Error occurred while removing build agent {}", buildAgentUrl, e );
                     throw new ContinuumException( "Error occurred while removing build agent " + buildAgentUrl, e );
                 }
                 catch ( StoppingException e )
                 {
-                    log.error( "Error occurred while removing build agent " + buildAgentUrl, e );
+                    log.error( "Error occurred while removing build agent {}", buildAgentUrl, e );
                     throw new ContinuumException( "Error occurred while removing build agent " + buildAgentUrl, e );
                 }
             }
@@ -342,6 +356,8 @@ public class DefaultDistributedBuildMana
                 {
                     if ( isAgentAvailable( buildAgentUrl ) )
                     {
+                        log.debug( "Getting projects in prepare build queue of build agent{}", buildAgentUrl );
+
                         SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
 
                         List<Map<String, Object>> projects = client.getProjectsInPrepareBuildQueue();
@@ -353,6 +369,10 @@ public class DefaultDistributedBuildMana
     
                         map.put( buildAgentUrl, tasks );
                     }
+                    else
+                    {
+                        log.debug( "Unable to get projects in prepare build queue. Build agent {} not available", buildAgentUrl );
+                    }
                 }
                 catch ( MalformedURLException e )
                 {
@@ -384,6 +404,8 @@ public class DefaultDistributedBuildMana
                 {
                     if ( isAgentAvailable( buildAgentUrl ) )
                     {
+                        log.debug( "Getting project currently preparing build in build agent {}", buildAgentUrl );
+
                         SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                         Map<String, Object> project = client.getProjectCurrentlyPreparingBuild();
     
@@ -392,6 +414,10 @@ public class DefaultDistributedBuildMana
                             map.put( buildAgentUrl, getPrepareBuildProjectsTask( project ) );
                         }
                     }
+                    else
+                    {
+                        log.debug( "Unable to get projects currently preparing build. Build agent {} is not available", buildAgentUrl );
+                    }
                 }
                 catch ( MalformedURLException e )
                 {
@@ -423,6 +449,8 @@ public class DefaultDistributedBuildMana
                 {
                     if ( isAgentAvailable( buildAgentUrl ) )
                     {
+                        log.debug( "Getting projects currently building in build agent {}", buildAgentUrl );
+
                         SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                         Map<String, Object> project = client.getProjectCurrentlyBuilding();
     
@@ -431,6 +459,10 @@ public class DefaultDistributedBuildMana
                             map.put( buildAgentUrl, getBuildProjectTask( project ) );
                         }
                     }
+                    else
+                    {
+                        log.debug( "Unable to get projects currently building. Build agent {} is not available", buildAgentUrl );
+                    }
                 }
                 catch ( MalformedURLException e )
                 {
@@ -464,6 +496,8 @@ public class DefaultDistributedBuildMana
                 {
                     if ( isAgentAvailable( buildAgentUrl ) )
                     {
+                        log.debug( "Getting projects in build queue in build agent {}", buildAgentUrl );
+
                         SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                         List<Map<String, Object>> projects = client.getProjectsInBuildQueue();
     
@@ -474,6 +508,10 @@ public class DefaultDistributedBuildMana
     
                         map.put( buildAgentUrl, tasks );
                     }
+                    else
+                    {
+                        log.debug( "Unable to get projects in build queue. Build agent {} is not available", buildAgentUrl );
+                    }
                 }
                 catch ( MalformedURLException e )
                 {
@@ -501,11 +539,11 @@ public class DefaultDistributedBuildMana
             if ( overallDistributedBuildQueue != null && 
                  overallDistributedBuildQueue.getDistributedBuildTaskQueueExecutor().getCurrentTask() != null )
             {
-                log.info( "build agent '" + buildAgentUrl + "' is busy" );
+                log.debug( "build agent '" + buildAgentUrl + "' is busy" );
                 return true;
             }
 
-            log.info( "build agent '" + buildAgentUrl + "' is not busy" );
+            log.debug( "build agent '" + buildAgentUrl + "' is not busy" );
             return false;
         }
     }
@@ -517,10 +555,16 @@ public class DefaultDistributedBuildMana
         {
             if ( isAgentAvailable( buildAgentUrl ) )
             {
+                log.debug( "Cancelling build in build agent {}", buildAgentUrl );
+
                 SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
     
                 client.cancelBuild();
             }
+            else
+            {
+                log.debug( "Unable to cancel build, build agent {} is not available", buildAgentUrl );
+            }
 
             // call reload in case we disable the build agent
             reload();
@@ -546,6 +590,7 @@ public class DefaultDistributedBuildMana
 
         if ( buildAgentUrl == null )
         {
+            log.debug( "Unable to determine the build agent where project is building" );
             return null;
         }
 
@@ -553,6 +598,7 @@ public class DefaultDistributedBuildMana
         {
             if ( isAgentAvailable( buildAgentUrl ) )
             {
+                log.debug( "Getting build result of project in build agent {}", buildAgentUrl );
                 SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
 
                 Map<String, Object> result = client.getBuildResult( projectId );
@@ -578,6 +624,14 @@ public class DefaultDistributedBuildMana
                     map.put( ContinuumBuildConstant.KEY_BUILD_RESULT, buildResult );
                     map.put( ContinuumBuildConstant.KEY_BUILD_OUTPUT, buildOutput );
                 }
+                else
+                {
+                    log.debug( "No build result returned by build agent {}", buildAgentUrl );
+                }
+            }
+            else
+            {
+                log.debug( "Unable to get build result of project. Build agent {} is not available", buildAgentUrl );
             }
         }
         catch ( MalformedURLException e )
@@ -603,9 +657,15 @@ public class DefaultDistributedBuildMana
             String platform = "";
             if ( isAgentAvailable( buildAgentUrl ) )
             {
+                log.debug( "Getting build agent {} platform", buildAgentUrl );
+
                 SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 platform = client.getBuildAgentPlatform();
             }
+            else
+            {
+                log.debug( "Unable to get build agent platform. Build agent {} is not available", buildAgentUrl );
+            }
             // call reload in case we disable the build agent
             reload();
             return platform;
@@ -626,6 +686,8 @@ public class DefaultDistributedBuildMana
         {
             if ( isAgentAvailable( buildAgentUrl ) )
             {
+                log.debug( "Getting available installations in build agent {}", buildAgentUrl );
+
                 SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
 
                 List<Map<String, String>> installationsList = client.getAvailableInstallations();
@@ -640,6 +702,10 @@ public class DefaultDistributedBuildMana
                     installations.add( installation );
                 }
             }
+            else
+            {
+                log.debug( "Unable to get available installations. Build agent {} is not available", buildAgentUrl );
+            }
 
             // call reload in case we disable the build agent
             reload();
@@ -663,6 +729,8 @@ public class DefaultDistributedBuildMana
 
             if ( buildAgentUrl == null )
             {
+                log.debug( "Unable to determine the build agent where project last built" );
+
                 return "";
             }
 
@@ -675,9 +743,15 @@ public class DefaultDistributedBuildMana
 
                 if ( isAgentAvailable( buildAgentUrl ) )
                 {
+                    log.debug( "Generating working copy content of project in build agent {}", buildAgentUrl );
+
                     SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                     return client.generateWorkingCopyContent( projectId, directory, baseUrl, imageBaseUrl );
                 }
+                else
+                {
+                    log.debug( "Unable to generate working copy content of project. Build agent {} is not available", buildAgentUrl );
+                }
             }
             catch ( MalformedURLException e )
             {
@@ -688,6 +762,10 @@ public class DefaultDistributedBuildMana
                 log.error( "Error while generating working copy content from build agent " + buildAgentUrl, e );
             }
         }
+        else
+        {
+            log.debug( "Unable to generate working copy content. Project hasn't been built yet." );
+        }
 
         // call reload in case we disable the build agent
         reload();
@@ -706,6 +784,7 @@ public class DefaultDistributedBuildMana
 
             if ( buildAgentUrl == null )
             {
+                log.debug( "Unable to determine build agent where project last built" );
                 return "";
             }
 
@@ -726,6 +805,10 @@ public class DefaultDistributedBuildMana
                 log.error( "Error while retrieving content of " + filename, e );
             }
         }
+        else
+        {
+            log.debug( "Unable to get file content because project hasn't been built yet" );
+        }
 
         // call reload in case we disable the build agent
         reload();
@@ -740,9 +823,16 @@ public class DefaultDistributedBuildMana
         {
             if ( isAgentAvailable( buildAgentUrl ) )
             {
+                log.debug( "Removing projectGroupId {} from prepare build queue of build agent {}", projectGroupId, buildAgentUrl );
+
                 SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 client.removeFromPrepareBuildQueue( projectGroupId, scmRootId );
             }
+            else
+            {
+                log.debug( "Unable to remove projectGroupId {} from prepare build queue. Build agent {} is not available", 
+                           projectGroupId, buildAgentUrl );
+            }
         }
         catch ( MalformedURLException e )
         {
@@ -770,9 +860,14 @@ public class DefaultDistributedBuildMana
         {
             if ( isAgentAvailable( buildAgentUrl ) )
             {
+                log.debug( "Removing projectId {} from build queue of build agent {}", projectId, buildAgentUrl );
                 SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 client.removeFromBuildQueue( projectId, buildDefinitionId );
             }
+            else
+            {
+                log.debug( "Unable to remove projectId {} from build queue. Build agent {} is not available", projectId, buildAgentUrl );
+            }
         }
         catch ( MalformedURLException e )
         {
@@ -804,9 +899,15 @@ public class DefaultDistributedBuildMana
                 {
                     if ( isAgentAvailable( buildAgentUrl ) )
                     {
+                        log.debug( "Removing project groups from prepare build queue of build agent {}", buildAgentUrl );
+
                         SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                         client.removeFromPrepareBuildQueue( hashCodes );
                     }
+                    else
+                    {
+                        log.debug( "Unable to remove project groups from prepare build queue. Build agent {} is not available", buildAgentUrl );
+                    }
                 }
                 catch ( MalformedURLException e )
                 {
@@ -834,9 +935,15 @@ public class DefaultDistributedBuildMana
                 {
                     if ( isAgentAvailable( buildAgentUrl ) )
                     {
+                        log.debug( "Removing projects from build queue of build agent {}", buildAgentUrl );
+
                         SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                         client.removeFromBuildQueue( hashCodes );
                     }
+                    else
+                    {
+                        log.debug( "Unable to remove projects from build queue. Build agent {} is not available", buildAgentUrl );
+                    }
                 }
                 catch ( MalformedURLException e )
                 {
@@ -866,6 +973,8 @@ public class DefaultDistributedBuildMana
                 {
                     if ( isAgentAvailable( buildAgentUrl ) )
                     {
+                        log.debug( "Checking if project {} is in prepare build queue of build agent {}", projectId, buildAgentUrl );
+
                         SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
 
                         List<Map<String, Object>> projects = client.getProjectsAndBuildDefinitionsInPrepareBuildQueue();
@@ -883,6 +992,11 @@ public class DefaultDistributedBuildMana
 
                         }
                     }
+                    else
+                    {
+                        log.debug( "Unable to check if project {} is in prepare build queue. Build agent {} is not available",
+                                   projectId, buildAgentUrl );
+                    }
 
                     if ( found )
                     {
@@ -946,6 +1060,8 @@ public class DefaultDistributedBuildMana
                 {
                     if ( isAgentAvailable( buildAgentUrl ) )
                     {
+                        log.debug( "Checking if project {} is currently preparing build in build agent {}", projectId, buildAgentUrl );
+
                         SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                         List<Map<String, Object>> projects = client.getProjectsAndBuildDefinitionsCurrentlyPreparingBuild();
     
@@ -961,6 +1077,11 @@ public class DefaultDistributedBuildMana
                             }
                         }
                     }
+                    else
+                    {
+                        log.debug( "Unable to check if project {} is currently preparing build. Build agent {} is not available",
+                                   projectId, buildAgentUrl );
+                    }
 
                     if ( found )
                     {
@@ -1036,14 +1157,20 @@ public class DefaultDistributedBuildMana
                                 break;
                             }
                         }
+                        else
+                        {
+                            log.debug( "Unable to check if project {} is currently building. Build agent {} is not available",
+                                       projectId, buildAgentUrl );
+                        }
                     }
                     catch ( MalformedURLException e )
                     {
-                        log.warn( "Unable to check if project " + projectId + " is currently building in agent: Invalid build agent url" + buildAgentUrl );
+                        log.warn( "Unable to check if project {} is currently building in agent: Invalid build agent url {}",
+                                  projectId, buildAgentUrl );
                     }
                     catch ( Exception e )
                     {
-                        log.warn( "Unable to check if project " + projectId + " is currently building in agent", e );
+                        log.warn( "Unable to check if project {} is currently building in agent", projectId, e );
                     }
                 }
             }
@@ -1073,6 +1200,8 @@ public class DefaultDistributedBuildMana
                     {
                         if ( isAgentAvailable( buildAgentUrl ) )
                         {
+                            log.debug( "Checking if project {} is currently queued or processed in agent {}", projectId, buildAgentUrl );
+
                             SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                             
                             if ( client.isProjectGroupCurrentlyPreparingBuild( projectId ) ||
@@ -1084,14 +1213,20 @@ public class DefaultDistributedBuildMana
                                 break;
                             }
                         }
+                        else
+                        {
+                            log.debug( "Unable to check if project {} is currently queued or processed in agent. Build agent {} is not available", 
+                                       projectId, buildAgentUrl );
+                        }
                     }
                     catch ( MalformedURLException e )
                     {
-                        log.warn( "Unable to check if project " + projectId + " is currently queued or processed in agent: Invalid build agent url" + buildAgentUrl );
+                        log.warn( "Unable to check if project {} is currently queued or processed in agent: Invalid build agent url {}",
+                                  projectId, buildAgentUrl );
                     }
                     catch ( Exception e )
                     {
-                        log.warn( "Unable to check if project " + projectId + " is currently queued or processed in agent", e );
+                        log.warn( "Unable to check if project {} is currently queued or processed in agent", projectId, e );
                     }
                 }
             }
@@ -1117,36 +1252,6 @@ public class DefaultDistributedBuildMana
         }
     }
 
-    private OverallDistributedBuildQueue getOverallDistributedBuildQueueByGroupAndScmRoot( int projectGroupId, int scmRootId )
-        throws ContinuumException
-    {
-        synchronized( overallDistributedBuildQueues )
-        {
-            for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
-            {
-                OverallDistributedBuildQueue distributedBuildQueue = overallDistributedBuildQueues.get( buildAgentUrl );
-
-                try
-                {
-                    for ( PrepareBuildProjectsTask task : distributedBuildQueue.getProjectsInQueue() )
-                    {
-                        if ( task.getProjectGroupId() == projectGroupId && task.getProjectScmRootId() == scmRootId )
-                        {
-                            return distributedBuildQueue;
-                        }
-                    }
-                }
-                catch ( TaskQueueException e )
-                {
-                    log.error( "Error occurred while retrieving distributed build queue of projectGroupId=" + projectGroupId + " scmRootId=" + scmRootId, e );
-                    throw new ContinuumException( "Error occurred while retrieving distributed build queue of group", e );
-                }
-            }
-        }
-
-        return null;
-    }
-
     private OverallDistributedBuildQueue getOverallDistributedBuildQueueByScmRoot( ProjectScmRoot scmRoot, int projectGroupId )
         throws ContinuumException
     {
@@ -1164,6 +1269,7 @@ public class DefaultDistributedBuildMana
                     {
                         if ( task.getProjectScmRootId() == scmRootId )
                         {
+                            log.debug( "Projects in the same continuum group are building in build agent: {}. Also building project in the same agent.", buildAgentUrl );
                             return distributedBuildQueue;
                         }
                     }
@@ -1171,6 +1277,7 @@ public class DefaultDistributedBuildMana
                     Task task = distributedBuildQueue.getDistributedBuildTaskQueueExecutor().getCurrentTask();
                     if ( task != null && ( (PrepareBuildProjectsTask) task ).getProjectScmRootId() == scmRootId )
                     {
+                        log.debug( "Projects in the same continuum group are building in build agent: {}. Also building project in the same agent.", buildAgentUrl );
                         return distributedBuildQueue;
                     }
 
@@ -1191,6 +1298,7 @@ public class DefaultDistributedBuildMana
 
                         if ( client.isProjectScmRootInQueue( scmRootId, pIds ) )
                         {
+                            log.debug( "Projects in the same continuum group are building in build agent: {}. Also building project in the same agent.", buildAgentUrl );
                             return distributedBuildQueue;
                         }
                     }
@@ -1223,6 +1331,8 @@ public class DefaultDistributedBuildMana
     {
         if ( scmRoots != null )
         {
+            log.debug( "Checking if the project group is already building in one of the build agents" );
+
             for ( ProjectScmRoot scmRoot : scmRoots )
             {
                 if ( scmRoot.getId() == scmRootId )
@@ -1238,37 +1348,6 @@ public class DefaultDistributedBuildMana
         return null;
     }
 
-    // need to change this
-    private OverallDistributedBuildQueue getOverallDistributedBuildQueueByHashCode( int hashCode )
-        throws ContinuumException
-    {
-        synchronized( overallDistributedBuildQueues )
-        {
-            for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
-            {
-                OverallDistributedBuildQueue distributedBuildQueue = overallDistributedBuildQueues.get( buildAgentUrl );
-
-                try
-                {
-                    for ( PrepareBuildProjectsTask task : distributedBuildQueue.getProjectsInQueue() )
-                    {
-                        if ( task.getHashCode() == hashCode )
-                        {
-                            return distributedBuildQueue;
-                        }
-                    }
-                }
-                catch ( TaskQueueException e )
-                {
-                    log.error( "Error occurred while retrieving distributed build queue", e );
-                    throw new ContinuumException( "Error occurred while retrieving distributed build queue", e );
-                }
-            }
-        }
-
-        return null;
-    }
-
     private OverallDistributedBuildQueue getOverallDistributedBuildQueueByAgentGroup( Map<Integer, Integer> projectsAndBuildDefinitionsMap )
         throws ContinuumException
     {
@@ -1306,9 +1385,12 @@ public class DefaultDistributedBuildMana
                                 {
                                     if ( isAgentAvailable( buildAgentUrl ) )
                                     {
+                                        log.debug( "Build agent {} is available", buildAgentUrl );
+
                                         SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                                         int agentBuildSize = client.getBuildSizeOfAgent();
     
+                                        log.debug( "Number of projects currently building in agent: {}", agentBuildSize );
                                         if ( idx == 0 )
                                         {
                                             whereToBeQueued = distributedBuildQueue;
@@ -1367,9 +1449,12 @@ public class DefaultDistributedBuildMana
                     {
                         if ( isAgentAvailable( buildAgentUrl ) )
                         {
+                            log.debug( "Build agent is available: {}", buildAgentUrl );
+
                             SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                             int agentBuildSize = client.getBuildSizeOfAgent();
-    
+
+                            log.debug( "Number of projects currently building in agent: {}", agentBuildSize );
                             if ( idx == 0 )
                             {
                                 whereToBeQueued = distributedBuildQueue;
@@ -1522,6 +1607,8 @@ public class DefaultDistributedBuildMana
                 try
                 {
                     configurationService.store();
+
+                    log.debug( "Disabled build agent {}", buildAgentUrl );
                 }
                 catch ( Exception e )
                 {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=1148725&r1=1148724&r2=1148725&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Wed Jul 20 12:29:49 2011
@@ -3658,7 +3658,7 @@ public class DefaultContinuum
             // check if project already in queue
             if ( !isProjectOkToBuild( projectId, buildDefinitionId ) )
             {
-                log.info( "not building" );
+                log.info( "Not queueing the build with projectId={} and buildDefinitionId={} because it is already building", projectId, buildDefinitionId );
                 continue;
             }
 

Modified: continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java?rev=1148725&r1=1148724&r2=1148725&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java (original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java Wed Jul 20 12:29:49 2011
@@ -78,11 +78,11 @@ public class MasterBuildAgentTransportCl
         try
         {
             result = master.returnBuildResult( buildResult );
-            log.info( "Returning the build result for project " + projectInfo + "." );
+            log.debug( "Returning the build result for project {}", projectInfo );
         }
         catch ( Exception e )
         {
-            log.error( "Failed to return the build result for project " + projectInfo + ".", e );
+            log.error( "Failed to return the build result for project {}", projectInfo, e );
             throw new Exception( "Failed to return the build result for project " + projectInfo + ".", e );
         }
 
@@ -97,11 +97,11 @@ public class MasterBuildAgentTransportCl
         try
         {
             result = master.ping();
-            log.info( "Ping " + ( result ? "ok" : "failed" ) );
+            log.debug( "Ping " + ( result ? "ok" : "failed" ) );
         }
         catch ( Exception e )
         {
-            log.info( "Ping error" );
+            log.error( "Ping error" );
             throw new Exception( "Ping error", e );
         }
 
@@ -117,11 +117,11 @@ public class MasterBuildAgentTransportCl
         try
         {
             result = master.prepareBuildFinished( prepareBuildResult );
-            log.info( "Prepare build finished for project " + projectInfo + "." );
+            log.debug( "Prepare build finished for project '{}'", projectInfo );
         }
         catch ( Exception e )
         {
-            log.error( "Failed to finish prepare build for project " + projectInfo + "." );
+            log.error( "Failed to finish prepare build for project {}", projectInfo );
             throw new Exception( "Failed to finish prepare build for project " + projectInfo + ".", e );
         }
 
@@ -136,11 +136,11 @@ public class MasterBuildAgentTransportCl
         try
         {
             result = master.startProjectBuild( projectId );
-            log.info( "Return project currently building, projectId=" + projectId );
+            log.debug( "Return project currently building, projectId={}", projectId );
         }
         catch ( Exception e )
         {
-            log.error( "Failed to return project currently building, projectId=" + projectId, e );
+            log.error( "Failed to return project currently building, projectId={}", projectId, e );
             throw new Exception( "Failed to return project currently building, projectId=" + projectId, e );
         }
 
@@ -156,11 +156,11 @@ public class MasterBuildAgentTransportCl
         try
         {
             result = master.startPrepareBuild( prepareBuildResult );
-            log.info( "Start prepare build for project " + projectInfo );
+            log.debug( "Start prepare build for project {}", projectInfo );
         }
         catch ( Exception e )
         {
-            log.error( "Failed to start prepare build for project " + projectInfo, e );
+            log.error( "Failed to start prepare build for project {}", projectInfo, e );
             throw new Exception( "Failed to start prepare build for project " + projectInfo, e );
         }
 
@@ -174,7 +174,7 @@ public class MasterBuildAgentTransportCl
         try
         {
             result = master.getEnvironments( buildDefinitionId, installationType );
-            log.info( "Retrieved environments. buildDefinitionId=" + buildDefinitionId + ", installationType=" + installationType );
+            log.debug( "Retrieved environments. buildDefinitionId={}, installationType={}", buildDefinitionId, installationType );
         }
         catch ( Exception e )
         {
@@ -196,11 +196,11 @@ public class MasterBuildAgentTransportCl
         try
         {
             result = master.updateProject( project );
-            log.info( "Updating project " + projectInfo );
+            log.debug( "Updating project {}", projectInfo );
         }
         catch ( Exception e )
         {
-            log.error( "Failed to update project " + projectInfo, e );
+            log.error( "Failed to update project {}", projectInfo, e );
             throw new Exception( "Failed to update project " + projectInfo, e );
         }
 
@@ -216,11 +216,11 @@ public class MasterBuildAgentTransportCl
         try
         {
             result = master.shouldBuild( context );
-            log.info( "Checking if project " + projectInfo + " should build" );
+            log.debug( "Checking if project {} should build", projectInfo );
         }
         catch ( Exception e )
         {
-            log.error( "Failed to determine if project " + projectInfo + " should build", e );
+            log.error( "Failed to determine if project {} should build", projectInfo, e );
             throw new Exception( "Failed to determine if project " + projectInfo + " should build", e );
         }
 



Mime
View raw message