Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1045#discussion_r162244374
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/WriterRecordBatch.java
 ---
    @@ -118,7 +118,7 @@ public IterOutcome innerNext() {
         } catch(IOException ex) {
           logger.error("Failure during query", ex);
           kill(false);
    -      context.fail(ex);
    +      context.getExecutorState().fail(ex);
    --- End diff --
    
    At some point, you may want to lead a cleanup of Drill's failure reporting 
design. I took a crack a while back. We have multiple ways of reporting errors:
    
    * Throw a UserException explaining the error
    * Throw an unchecked exception and and let the fragment executor guess the 
cause.
    * Return STOP
    * Tell the fragment executor to fail. (A we also required to return STOP?)
    * Return OUT_OF_MEMORY status
    
    The proposal is to replace them all with a single solution: throw a 
UserException. Each operator catches other exceptions and translates them to 
UserException.
    
    Java unwinds the stack just fine; no reason for us to write code to do it 
via STOP.
    
    Then, the Fragment Executor calls close() on all operators. No reason to 
try to do this cleanup on STOP. (Even if we do, the lower-level operators won't 
have seen the STOP.)
    
    Since failures are hard to test, and have cause no end of problems, having 
multiple ways to do the same thing is really not that helpful to Drill users.


---

Reply via email to