Buggy code:
public class GLM extends SupervisedModelBuilder < GLMModel , GLMModel . GLMParameters , GLMModel . GLMOutput > { private static final double LINE_SEARCH_STEP = 0.7 ; private static final int NUM_LINE_SEARCH_STEPS = 32 ; @ Override public ModelCategory [ ] can_build ( ) { } public GLM ( Key dest , String desc , GLMModel . GLMParameters parms ) { } public GLM ( GLMModel . GLMParameters parms ) { } private static class TooManyPredictorsException extends RuntimeException { } @ Override public void init ( boolean expensive ) { } @ Override public ModelBuilderSchema schema ( ) { } private static final int WORK_TOTAL = 100000000 ; private boolean _clean_enums ; @ Override public Job < GLMModel > trainModel ( ) { _clean_enums = ( _parms . _convert_to_enum ) && ( ! ( _response . isEnum ( ) ) ) ; _parms . read_lock_frames ( this ) ; init ( true ) ; DataInfo dinfo = new DataInfo ( Key . make ( ) , _train , _valid , 1 , ( ( _parms . _use_all_factor_levels ) || ( _parms . _lambda_search ) ) , ( _parms . _standardize ? TransformType . STANDARDIZE : TransformType . NONE ) , TransformType . NONE , true ) ; DKV . put ( dinfo . _key , dinfo ) ; H2OCountedCompleter cmp = new H2OCountedCompleter ( ) { AtomicBoolean _gotException = new AtomicBoolean ( false ) ; @ Override public void compute2 ( ) { } @ Override public void onCompletion ( CountedCompleter cc ) { done ( ) ; _parms . read_unlock_frames ( GLM . this ) ; if ( _clean_enums ) { train ( ) . lastVec ( ) . remove ( ) ; if ( ( valid ( ) ) != null ) valid ( ) . lastVec ( ) . remove ( ) ; } } @ Override public boolean onExceptionalCompletion ( Throwable ex , CountedCompleter cc ) { if ( ! ( _gotException . getAndSet ( true ) ) ) { Job thisJob = DKV . getGet ( _key ) ; <START_BUG> if ( ( thisJob . _state ) == ( JobState . CANCELLED ) ) { <END_BUG> failed ( ex ) ; } _parms . read_unlock_frames ( GLM . this ) ; if ( _clean_enums ) { train ( ) . lastVec ( ) . remove ( ) ; if ( ( valid ( ) ) != null ) valid ( ) . lastVec ( ) . remove ( ) ; } return true ; } return false ; } } ; start ( cmp , GLM . WORK_TOTAL ) ; H2O . submitTask ( new GLM . GLMDriver ( cmp , dinfo ) ) ; return this ; } private static double GLM_GRAD_EPS = 1.0E-4 ; private static final int MAX_ITERATIONS_PER_LAMBDA = 10 ; private static final int MAX_ITER = 50 ; private static final int sparseCoefThreshold = 750 ; private static final double beta_epsilon = 1.0E-4 ; public static final class GLMTaskInfo extends Iced { final long _nobs ; final double _ymu ; final double _lambdaMax ; double [ ] _beta ; GradientInfo _ginfo ; int _iter ; int _max_iter ; float [ ] _thresholds ; final Key _dstKey ; final DataInfo _dinfo ; final GLMParameters _params ; L_BFGS _lbfgs ; GradientInfo _gOld ; public GLMTaskInfo ( Key dstKey , DataInfo dinfo , GLMParameters params , long nobs , double ymu , double lmax , double [ ] beta , GradientInfo ginfo ) { } public void adjustToNewLambda ( double currentLambda , double newLambda ) { } } public static final class GLMLambdaTask extends DTask < GLM . GLMLambdaTask > { DataInfo _activeData ; GLM . GLMTaskInfo _taskInfo ; final double _currentLambda ; final double _lastLambda ; int _iter ; final Key _jobKey ; Key _progressKey ; long _start_time ; double _addedL2 ; final boolean _forceLBFGS ; public GLMLambdaTask ( H2OCountedCompleter cmp , Key jobKey , Key progressKey , GLM . GLMTaskInfo state , double lastLambda , double currentLambda , boolean forceLBFGS ) { } private String LogInfo ( String msg ) { } int [ ] _activeCols ; private int [ ] activeCols ( final double l1 , final double l2 , final double [ ] grad ) { } private static final class IterationInfo { final double [ ] _beta ; final double [ ] _grad ; final double _objval ; final int _iter ; public IterationInfo ( int iter , double [ ] beta , double [ ] grad , double objval ) { } } private transient GLM . GLMLambdaTask . IterationInfo _lastResult ; private double [ ] setSubmodel ( final double [ ] newBeta , GLMValidation val , H2O . H2OCountedCompleter cmp ) { } protected void checkKKTAndComplete ( final double [ ] newBeta , final boolean failedLineSearch ) { } private static final boolean isSparse ( Frame f ) { } private GradientInfo adjustL2 ( GradientInfo ginfo , double [ ] coefs , double lambdaDiff ) { } private MRTask makeGLMTask ( Key jobKey , DataInfo dinfo , GLMParameters params , boolean computeGram , boolean validate , boolean computeGradient , double [ ] beta ) { } @ Override protected void compute2 ( ) { } private class Iteration extends H2O . H2OCallback < GLMIterationTask > { public final long _iterationStartTime ; final boolean _countIteration ; final double _lineSearchStep ; public Iteration ( CountedCompleter cmp ) { } public Iteration ( CountedCompleter cmp , boolean countIteration , double lineSearchStep ) { } @ Override public void callback ( final GLMIterationTask glmt ) { } } private class LineSearchIteration extends H2O . H2OCallback < GLMLineSearchTask > { LineSearchIteration ( CountedCompleter cmp ) { } @ Override public void callback ( final GLMLineSearchTask lst ) { } } } private final double lmax ( GLMGradientTask gLmax ) { } public final class GLMDriver extends DTask < GLM . GLMDriver > { final DataInfo _dinfo ; transient ArrayList < DataInfo > _foldInfos = new ArrayList < DataInfo > ( ) ;

Fix:
if ( ( thisJob . _state ) != ( JobState . CANCELLED ) ) {