public void onEvaluatorException ( final EvaluatorException exception ) { synchronized ( this . evaluatorDescriptor ) { if ( this . stateManager . isCompleted ( ) ) { LOG . log ( Level . FINE , "Ignoring an exception received for Evaluator {0} which is already in state {1}." , new Object [ ] { this . getId ( ) , this . stateManager } ) ; return ; } LOG . log ( Level . WARNING , "Failed evaluator: " + getId ( ) , exception ) ; try { final List < FailedContext > failedContextList = this . contextRepresenters . getFailedContextsForEvaluatorFailure ( ) ; final Optional < FailedTask > failedTaskOptional ; if ( this . task . isPresent ( ) ) { final String taskId = this . task . get ( ) . getId ( ) ; final Optional < ActiveContext > evaluatorContext = Optional . empty ( ) ; final Optional < byte [ ] > bytes = Optional . empty ( ) ; final Optional < Throwable > taskException = Optional . < Throwable > of ( new Exception ( "Evaluator crash" ) ) ; final String message = "Evaluator crash" ; final Optional < String > description = Optional . empty ( ) ; final FailedTask failedTask = new FailedTask ( taskId , message , description , taskException , bytes , evaluatorContext ) ; failedTaskOptional = Optional . of ( failedTask ) ; } else { failedTaskOptional = Optional . empty ( ) ; } final FailedEvaluator failedEvaluator = new FailedEvaluatorImpl ( exception , failedContextList , failedTaskOptional , this . evaluatorId ) ; if ( driverRestartManager . getEvaluatorRestartState ( evaluatorId ) . isFailedOrExpired ( ) ) { this . messageDispatcher . onDriverRestartEvaluatorFailed ( failedEvaluator ) ; } else { this . messageDispatcher . onEvaluatorFailed ( failedEvaluator ) ; } } catch ( final Exception e ) { LOG . log ( Level . SEVERE , "Exception while handling FailedEvaluator" , e ) ; } finally { this . stateManager . setFailed ( ) ; this . close ( ) ; } } }
EvaluatorException will trigger is FailedEvaluator and state transition to FAILED .