Author: degenaro
Date: Mon Sep 19 16:55:11 2016
New Revision: 1761483

URL: http://svn.apache.org/viewvc?rev=1761483&view=rev
Log:
UIMA-5110 DUCC Job Driver (JD) erroneously logs ***** TIMEOUT *****

Modified:
    
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEnd.java
    
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEndAbstract.java
    
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEndTimeout.java
    
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/user/error/classload/ProxyUserErrorStringify.java

Modified: 
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEnd.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEnd.java?rev=1761483&r1=1761482&r2=1761483&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEnd.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEnd.java
 Mon Sep 19 16:55:11 2016
@@ -215,9 +215,11 @@ public class ActionEnd extends ActionEnd
                                                        printableException = 
proxy.convert(userException);
                                                }
                                                catch(Exception e) {
-                                                       logger.error(location, 
ILogger.null_id, e);
+                                                       MessageBuffer eb = 
LoggerHelper.getMessageBuffer(actionData);
+                                                       eb.append("unable to 
convert user job process exception into printable form");
+                                                       logger.error(location, 
ILogger.null_id, eb.toString());
                                                }
-                                               handleException(actionData, 
userException, printableException);
+                                               handleException(actionData, 
ExceptionType.User, userException, printableException);
                                                
displayProcessStatistics(logger, actionData, wi, pStats);
                                        }
                                        else {

Modified: 
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEndAbstract.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEndAbstract.java?rev=1761483&r1=1761482&r2=1761483&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEndAbstract.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEndAbstract.java
 Mon Sep 19 16:55:11 2016
@@ -43,6 +43,8 @@ import org.apache.uima.ducc.container.ne
 
 public abstract class ActionEndAbstract extends Action implements IAction {
        
+       public enum ExceptionType { User, Timeout };
+       
        private Logger logger = Logger.getLogger(ActionEndAbstract.class, 
IComponent.Id.JD.name());
        
        protected ActionEndAbstract(Logger logger) {
@@ -55,7 +57,7 @@ public abstract class ActionEndAbstract
                return deallocateReason;
        }
        
-       protected void handleException(IActionData actionData, Object 
userException, String printableException) throws JobDriverException {
+       protected void handleException(IActionData actionData, ExceptionType 
exceptionType, Object userException, String printableException) throws 
JobDriverException {
                String location = "handleException";
                if(true) {
                        MessageBuffer mb = 
LoggerHelper.getMessageBuffer(actionData);
@@ -76,11 +78,18 @@ public abstract class ActionEndAbstract
                //
                int seqNo = metaCasHelper.getSystemKey();
                try {
-                       // Identify the timeout case in the header & record in 
one logger call as is multi-threadsd
-                       if (printableException != null) {
-                               
ActionHelper.toJdErrLog(Standardize.Label.seqNo.get()+seqNo+" ***** EXCEPTION 
*****\n"+printableException);
-                       } else {
+                       switch(exceptionType) {
+                       case User:
+                               if(printableException != null) {
+                                       
ActionHelper.toJdErrLog(Standardize.Label.seqNo.get()+seqNo+" ***** EXCEPTION 
*****\n"+printableException);
+                               }
+                               else {
+                                       
ActionHelper.toJdErrLog(Standardize.Label.seqNo.get()+seqNo+" ***** EXCEPTION 
*****\n");
+                               }
+                               break;
+                       case Timeout:
                                
ActionHelper.toJdErrLog(Standardize.Label.seqNo.get()+seqNo+" ***** TIMEOUT 
*****\n"+userException.toString()+"\n");
+                               break;
                        }
                }
                catch(Exception e) {

Modified: 
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEndTimeout.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEndTimeout.java?rev=1761483&r1=1761482&r2=1761483&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEndTimeout.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionEndTimeout.java
 Mon Sep 19 16:55:11 2016
@@ -67,7 +67,7 @@ public class ActionEndTimeout extends Ac
                                                mb.append("timeout");
                                                logger.info(location, 
ILogger.null_id, mb.toString());
                                                Exception userException = new 
Exception("Timeout - work-item exceeded the specified 
'process_per_item_time_max'");
-                                               handleException(actionData, 
userException, null);
+                                               handleException(actionData, 
ExceptionType.Timeout, userException, null);
                                                
displayProcessStatistics(logger, actionData, wi, pStats);
                                        }
                                        else {

Modified: 
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/user/error/classload/ProxyUserErrorStringify.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/user/error/classload/ProxyUserErrorStringify.java?rev=1761483&r1=1761482&r2=1761483&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/user/error/classload/ProxyUserErrorStringify.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/user/error/classload/ProxyUserErrorStringify.java
 Mon Sep 19 16:55:11 2016
@@ -71,8 +71,8 @@ public class ProxyUserErrorStringify {
                        retVal = (String)printableString;
                }
                catch(Exception e) {
-                       logger.error(location, ILogger.null_id, e);
-                       throw new ProxyUserErrorException(e.toString());
+                       logger.trace(location, ILogger.null_id, e);
+                       throw new ProxyUserErrorException(e);
                }
                return retVal;
        }


Reply via email to