You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2016/08/11 14:43:23 UTC

svn commit: r1755998 - /uima/uima-ducc/trunk/uima-ducc-pm/src/main/java/org/apache/uima/ducc/pm/ProcessManagerComponent.java

Author: cwiklik
Date: Thu Aug 11 14:43:23 2016
New Revision: 1755998

URL: http://svn.apache.org/viewvc?rev=1755998&view=rev
Log:
UIMA-5048 modified PM to ignore tasks for which there is no command line

Modified:
    uima/uima-ducc/trunk/uima-ducc-pm/src/main/java/org/apache/uima/ducc/pm/ProcessManagerComponent.java

Modified: uima/uima-ducc/trunk/uima-ducc-pm/src/main/java/org/apache/uima/ducc/pm/ProcessManagerComponent.java
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-pm/src/main/java/org/apache/uima/ducc/pm/ProcessManagerComponent.java?rev=1755998&r1=1755997&r2=1755998&view=diff
==============================================================================
--- uima/uima-ducc/trunk/uima-ducc-pm/src/main/java/org/apache/uima/ducc/pm/ProcessManagerComponent.java (original)
+++ uima/uima-ducc/trunk/uima-ducc-pm/src/main/java/org/apache/uima/ducc/pm/ProcessManagerComponent.java Thu Aug 11 14:43:23 2016
@@ -191,6 +191,14 @@ implements ProcessManager {
 	        case Job:
 	          logger.debug(methodName, dcj.getDuccId(), "case: Job");
 	          dw = dwHelper.fetch(dcj.getDuccId());
+	          // Aug 11, 2016 JIRA 5048
+	          // If the OR returns null from fetch() above, don't send anything to agents.
+	          // The dw contains a command line to launch processes. If its not provided 
+	          // there is nothing to do.
+	          if ( dw == null ) {
+	        	  logger.info(methodName, dcj.getDuccId(), "The OR did not provide commndline spec and other details required to launch processes for the Job. Received value of NULL from the OR. The PM will ignore this job and will not publish it to agents.");
+	        	  continue;  // nothing to do
+	          }
 	          IDuccWorkJob job = (IDuccWorkJob) dw;
 	          DuccWorkPopDriver driver = job.getDriver();
 			  if(driver != null) {
@@ -202,6 +210,11 @@ implements ProcessManager {
 	        case Service:
 	          logger.debug(methodName, dcj.getDuccId(), "case: Service");
 	          dw = dwHelper.fetch(dcj.getDuccId());
+	          if ( dw == null ) {
+	        	  logger.info(methodName, dcj.getDuccId(), "The OR did not provide commndline spec and other details required to launch Service processes. Received value of NULL from the OR. The PM will ignore this Service and will not publish to agents.");
+	        	  continue;  // nothing to do
+	          }
+
 	          IDuccWorkJob service = (IDuccWorkJob) dw;
 	          processCmdLine = service.getCommandLine();
 	          processCmdLine.addOption("-Dducc.deploy.components=service");
@@ -209,6 +222,11 @@ implements ProcessManager {
 	        default:
 	          logger.debug(methodName, dcj.getDuccId(), "case: default");
 	          dw = dwHelper.fetch(dcj.getDuccId());
+	          if ( dw == null ) {
+	        	  logger.info(methodName, dcj.getDuccId(), "The OR did not provide commndline spec and other details required to launch processes. Received value of NULL from the OR. The PM will ignore this task and will not publish to agents.");
+	        	  continue;  // nothing to do
+	          }
+
 	          if(dw instanceof IDuccWorkExecutable) {
 	        	  IDuccWorkExecutable dwe = (IDuccWorkExecutable) dw;
 	        	  processCmdLine = dwe.getCommandLine();