Author: degenaro
Date: Mon Jun 15 13:33:42 2015
New Revision: 1685579

URL: http://svn.apache.org/r1685579
Log:
UIMA-4465 DUCC Job Driver (JD) does not handle work item timeouts properly

Modified:
    
uima/sandbox/uima-ducc/trunk/uima-ducc-user/src/main/java/org/apache/uima/ducc/ErrorHandler.java

Modified: 
uima/sandbox/uima-ducc/trunk/uima-ducc-user/src/main/java/org/apache/uima/ducc/ErrorHandler.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-user/src/main/java/org/apache/uima/ducc/ErrorHandler.java?rev=1685579&r1=1685578&r2=1685579&view=diff
==============================================================================
--- 
uima/sandbox/uima-ducc/trunk/uima-ducc-user/src/main/java/org/apache/uima/ducc/ErrorHandler.java
 (original)
+++ 
uima/sandbox/uima-ducc/trunk/uima-ducc-user/src/main/java/org/apache/uima/ducc/ErrorHandler.java
 Mon Jun 15 13:33:42 2015
@@ -115,17 +115,25 @@ public class ErrorHandler implements IEr
        }
        
        @Override
-       public IErrorHandlerDirective handle(String serializedCAS, Object 
byteArray) {
+       public IErrorHandlerDirective handle(String serializedCAS, Object 
object) {
                ErrorHandlerDirective jdUserDirective = new 
ErrorHandlerDirective();
                try {
                        Throwable userThrowable = null;
                        if(serializedCAS != null) {
                                // CAS is provided
                        }
-                       if(byteArray != null) {
-                               userThrowable = 
Transformer.deserialize(byteArray);
-                               userThrowable.getClass();
-                               // Exception is provided
+                       if(object != null) {
+                               // JD exception (e.g. timeout)
+                               if(object instanceof Exception) {
+                                       userThrowable = (Throwable) object;
+                                       userThrowable.getClass();
+                               }
+                               // User code exception
+                               else {
+                                       Object byteArray = object;
+                                       userThrowable = 
Transformer.deserialize(byteArray);
+                                       userThrowable.getClass();
+                               }
                        }
                        jobErrorCount.incrementAndGet();
                        if(jobErrorCount.get() > jobErrorLimit.get()) {


Reply via email to