/** * Execute the rollback of the procedure step. * It updates the store with the new state (stack index) * or will remove completly the procedure in case it is a child. */ private LockState executeRollback(Procedure<TEnvironment> proc) { try { proc.doRollback(getEnvironment()); } catch (IOException e) { LOG.debug("Roll back attempt failed for {}", proc, e); return LockState.LOCK_YIELD_WAIT; } catch (InterruptedException e) { handleInterruptedException(proc, e); return LockState.LOCK_YIELD_WAIT; } catch (Throwable e) { // Catch NullPointerExceptions or similar errors... LOG.error(HBaseMarkers.FATAL, "CODE-BUG: Uncaught runtime exception for " + proc, e); } // allows to kill the executor before something is stored to the wal. // useful to test the procedure recovery. if (testing != null && testing.shouldKillBeforeStoreUpdate()) { String msg = "TESTING: Kill before store update"; LOG.debug(msg); stop(); throw new RuntimeException(msg); } cleanupAfterRollbackOneStep(proc); return LockState.LOCK_ACQUIRED; }
testing.shouldKillBeforeStoreUpdate(suspended, procedure.hasParent())) { kill("TESTING: Kill BEFORE store update: " + procedure);
/** * Execute the rollback of the procedure step. * It updates the store with the new state (stack index) * or will remove completly the procedure in case it is a child. */ private LockState executeRollback(Procedure<TEnvironment> proc) { try { proc.doRollback(getEnvironment()); } catch (IOException e) { LOG.debug("Roll back attempt failed for {}", proc, e); return LockState.LOCK_YIELD_WAIT; } catch (InterruptedException e) { handleInterruptedException(proc, e); return LockState.LOCK_YIELD_WAIT; } catch (Throwable e) { // Catch NullPointerExceptions or similar errors... LOG.error(HBaseMarkers.FATAL, "CODE-BUG: Uncaught runtime exception for " + proc, e); } // allows to kill the executor before something is stored to the wal. // useful to test the procedure recovery. if (testing != null && testing.shouldKillBeforeStoreUpdate()) { String msg = "TESTING: Kill before store update"; LOG.debug(msg); stop(); throw new RuntimeException(msg); } cleanupAfterRollbackOneStep(proc); return LockState.LOCK_ACQUIRED; }
if (testing != null && testing.shouldKillBeforeStoreUpdate()) { LOG.debug("TESTING: Kill before store update"); stop();
if (testing != null && testing.shouldKillBeforeStoreUpdate(suspended)) { kill("TESTING: Kill BEFORE store update: " + procedure);
if (testing != null && testing.shouldKillBeforeStoreUpdate(suspended)) { LOG.debug("TESTING: Kill before store update: " + procedure); stop();
if (testing != null && testing.shouldKillBeforeStoreUpdate()) { LOG.debug("TESTING: Kill before store update"); stop();
if (testing != null && testing.shouldKillBeforeStoreUpdate()) { LOG.debug("TESTING: Kill before store update"); stop();
protected boolean shouldKillBeforeStoreUpdate(final boolean isSuspended) { return (isSuspended && !killIfSuspended) ? false : shouldKillBeforeStoreUpdate(); }
protected boolean shouldKillBeforeStoreUpdate(final boolean isSuspended) { return (isSuspended && !killIfSuspended) ? false : shouldKillBeforeStoreUpdate(); } }
protected boolean shouldKillBeforeStoreUpdate(boolean isSuspended, boolean hasParent) { if (isSuspended && !killIfSuspended) { return false; } if (hasParent && !killIfHasParent) { return false; } return shouldKillBeforeStoreUpdate(); }