continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r725990 - in /continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed: executor/DistributedBuildProjectTaskExecutor.java manager/DefaultDistributedBuildManager.java
Date Fri, 12 Dec 2008 12:59:35 GMT
Author: ctan
Date: Fri Dec 12 04:59:35 2008
New Revision: 725990

URL: http://svn.apache.org/viewvc?rev=725990&view=rev
Log:
- fixed remove build agent task queue executor
- add call to cancelBuild() method of slave agent

Modified:
    continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
    continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java

Modified: continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java?rev=725990&r1=725989&r2=725990&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
Fri Dec 12 04:59:35 2008
@@ -89,12 +89,13 @@
                                                         prepareBuildTask.getScmRootAddress()
);
 
             startTime = System.currentTimeMillis();
-            if ( client.buildProjects( buildContext ) )
-            {
-                scmRoot.setOldState( scmRoot.getState() );
-                scmRoot.setState( ContinuumProjectState.UPDATING );
-                projectScmRootDao.updateProjectScmRoot( scmRoot );
-            }
+
+            scmRoot.setOldState( scmRoot.getState() );
+            scmRoot.setState( ContinuumProjectState.UPDATING );
+            projectScmRootDao.updateProjectScmRoot( scmRoot );
+
+            client.buildProjects( buildContext );
+
             endTime = System.currentTimeMillis();
         }
         catch ( MalformedURLException e )
@@ -235,7 +236,7 @@
         }
         catch ( ContinuumStoreException e )
         {
-            throw new TaskExecutionException( "" );
+            throw new TaskExecutionException( "Error while creating result", e );
         }
     }
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java?rev=725990&r1=725989&r2=725990&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
Fri Dec 12 04:59:35 2008
@@ -32,6 +32,7 @@
 
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.context.Context;
 import org.codehaus.plexus.context.ContextException;
@@ -186,11 +187,16 @@
         try
         {
             executor.stop();
+            container.release( executor );
         }
         catch ( StoppingException e )
         {
             throw new ContinuumException( "Error while stopping task queue executor", e );
         }
+        catch ( ComponentLifecycleException e )
+        {
+            throw new ContinuumException( "Error while releasing task queue executor from
container", e );
+        }
 
         taskQueueExecutors.remove( buildAgentUrl );
     }
@@ -226,6 +232,7 @@
     }
 
     public void cancelDistributedBuild( String buildAgentUrl, int projectGroupId, String
scmRootAddress )
+        throws ContinuumException
     {
         ThreadedDistributedBuildTaskQueueExecutor taskQueueExecutor = taskQueueExecutors.get(
buildAgentUrl );
 
@@ -243,6 +250,17 @@
                         log.info( "cancelling task for project group " + projectGroupId +

                                   " with scm root address " + scmRootAddress );
                         taskQueueExecutor.cancelTask( currentTask );
+
+                        try
+                        {
+                            ProxySlaveAgentTransportService client = new ProxySlaveAgentTransportService(
new URL( buildAgentUrl ) );
+                            client.cancelBuild();
+                        }
+                        catch ( Exception e )
+                        {
+                            log.error( "Error while cancelling build in build agent '" +
buildAgentUrl + "'" );
+                            throw new ContinuumException( "Error while cancelling build in
build agent '" + buildAgentUrl + "'", e );
+                        }
                     }
                     else
                     {



Mime
View raw message