private boolean tryClose() { try { Files.deleteIfExists(file.toPath()); return true; } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); } return false; }
@Test public void testRethrowFatalError() { // fatal error is rethrown try { ExceptionUtils.rethrowIfFatalError(new InternalError()); fail(); } catch (InternalError ignored) {} // non-fatal error is not rethrown ExceptionUtils.rethrowIfFatalError(new NoClassDefFoundError()); }
ExceptionUtils.rethrowIfFatalError(t); ExceptionUtils.rethrowIfFatalError(t);
ExceptionUtils.rethrowIfFatalError(t); log.error("Error in the task canceler for task {}.", taskName, t);
ExceptionUtils.rethrowIfFatalError(t); log.error("Error in the task canceler for task {}.", taskName, t);
ExceptionUtils.rethrowIfFatalError(t); log.error("Error in the task canceler for task {}.", taskName, t);
invokable.cancel(); } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); logger.error("Error while canceling the task {}.", taskName, t); partition.destroyBufferPool(); } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); LOG.error("Failed to release result partition buffer pool for task {}.", taskName, t); inputGate.releaseAllResources(); } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); LOG.error("Failed to release input gate for task {}.", taskName, t); ExceptionUtils.rethrowIfFatalError(t); logger.error("Error in the task canceler for task {}.", taskName, t);
invokable.cancel(); } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); logger.error("Error while canceling the task {}.", taskName, t); partition.destroyBufferPool(); } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); LOG.error("Failed to release result partition buffer pool for task {}.", taskName, t); inputGate.releaseAllResources(); } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); LOG.error("Failed to release input gate for task {}.", taskName, t); ExceptionUtils.rethrowIfFatalError(t); logger.error("Error in the task canceler for task {}.", taskName, t);
invokable.cancel(); } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); logger.error("Error while canceling the task {}.", taskName, t); partition.destroyBufferPool(); } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); LOG.error("Failed to release result partition buffer pool for task {}.", taskName, t); inputGate.releaseAllResources(); } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); LOG.error("Failed to release input gate for task {}.", taskName, t); ExceptionUtils.rethrowIfFatalError(t); logger.error("Error in the task canceler for task {}.", taskName, t);
private static <T> void restoreHook( final Object state, final MasterTriggerRestoreHook<?> hook, final long checkpointId) throws FlinkException { @SuppressWarnings("unchecked") final T typedState = (T) state; @SuppressWarnings("unchecked") final MasterTriggerRestoreHook<T> typedHook = (MasterTriggerRestoreHook<T>) hook; try { typedHook.restoreCheckpoint(checkpointId, typedState); } catch (FlinkException e) { throw e; } catch (Throwable t) { // catch all here, including Errors that may come from dependency and classpath issues ExceptionUtils.rethrowIfFatalError(t); throw new FlinkException("Error while calling restoreCheckpoint on checkpoint hook '" + hook.getIdentifier() + '\'', t); } }
private static <T> void restoreHook( final Object state, final MasterTriggerRestoreHook<?> hook, final long checkpointId) throws FlinkException { @SuppressWarnings("unchecked") final T typedState = (T) state; @SuppressWarnings("unchecked") final MasterTriggerRestoreHook<T> typedHook = (MasterTriggerRestoreHook<T>) hook; try { typedHook.restoreCheckpoint(checkpointId, typedState); } catch (FlinkException e) { throw e; } catch (Throwable t) { // catch all here, including Errors that may come from dependency and classpath issues ExceptionUtils.rethrowIfFatalError(t); throw new FlinkException("Error while calling restoreCheckpoint on checkpoint hook '" + hook.getIdentifier() + '\'', t); } }
private static <T> void restoreHook( final Object state, final MasterTriggerRestoreHook<?> hook, final long checkpointId) throws FlinkException { @SuppressWarnings("unchecked") final T typedState = (T) state; @SuppressWarnings("unchecked") final MasterTriggerRestoreHook<T> typedHook = (MasterTriggerRestoreHook<T>) hook; try { typedHook.restoreCheckpoint(checkpointId, typedState); } catch (FlinkException e) { throw e; } catch (Throwable t) { // catch all here, including Errors that may come from dependency and classpath issues ExceptionUtils.rethrowIfFatalError(t); throw new FlinkException("Error while calling restoreCheckpoint on checkpoint hook '" + hook.getIdentifier() + '\'', t); } }
private static <T> void restoreHook( final Object state, final MasterTriggerRestoreHook<?> hook, final long checkpointId) throws FlinkException { @SuppressWarnings("unchecked") final T typedState = (T) state; @SuppressWarnings("unchecked") final MasterTriggerRestoreHook<T> typedHook = (MasterTriggerRestoreHook<T>) hook; try { typedHook.restoreCheckpoint(checkpointId, typedState); } catch (FlinkException e) { throw e; } catch (Throwable t) { // catch all here, including Errors that may come from dependency and classpath issues ExceptionUtils.rethrowIfFatalError(t); throw new FlinkException("Error while calling restoreCheckpoint on checkpoint hook '" + hook.getIdentifier() + '\'', t); } }
/** * Called whenever a vertex reaches state FINISHED (completed successfully). * Once all vertices are in the FINISHED state, the program is successfully done. */ void vertexFinished() { final int numFinished = verticesFinished.incrementAndGet(); if (numFinished == numVerticesTotal) { // done :-) // check whether we are still in "RUNNING" and trigger the final cleanup if (state == JobStatus.RUNNING) { // we do the final cleanup in the I/O executor, because it may involve // some heavier work try { for (ExecutionJobVertex ejv : verticesInCreationOrder) { ejv.getJobVertex().finalizeOnMaster(getUserClassLoader()); } } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); failGlobal(new Exception("Failed to finalize execution on master", t)); return; } // if we do not make this state transition, then a concurrent // cancellation or failure happened if (transitionState(JobStatus.RUNNING, JobStatus.FINISHED)) { onTerminalState(JobStatus.FINISHED); } } } }
/** * Called whenever a vertex reaches state FINISHED (completed successfully). * Once all vertices are in the FINISHED state, the program is successfully done. */ void vertexFinished() { final int numFinished = verticesFinished.incrementAndGet(); if (numFinished == numVerticesTotal) { // done :-) // check whether we are still in "RUNNING" and trigger the final cleanup if (state == JobStatus.RUNNING) { // we do the final cleanup in the I/O executor, because it may involve // some heavier work try { for (ExecutionJobVertex ejv : verticesInCreationOrder) { ejv.getJobVertex().finalizeOnMaster(getUserClassLoader()); } } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); failGlobal(new Exception("Failed to finalize execution on master", t)); return; } // if we do not make this state transition, then a concurrent // cancellation or failure happened if (transitionState(JobStatus.RUNNING, JobStatus.FINISHED)) { onTerminalState(JobStatus.FINISHED); } } } }
/** * Called whenever a vertex reaches state FINISHED (completed successfully). * Once all vertices are in the FINISHED state, the program is successfully done. */ void vertexFinished() { final int numFinished = verticesFinished.incrementAndGet(); if (numFinished == numVerticesTotal) { // done :-) // check whether we are still in "RUNNING" and trigger the final cleanup if (state == JobStatus.RUNNING) { // we do the final cleanup in the I/O executor, because it may involve // some heavier work try { for (ExecutionJobVertex ejv : verticesInCreationOrder) { ejv.getJobVertex().finalizeOnMaster(getUserClassLoader()); } } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); failGlobal(new Exception("Failed to finalize execution on master", t)); return; } // if we do not make this state transition, then a concurrent // cancellation or failure happened if (transitionState(JobStatus.RUNNING, JobStatus.FINISHED)) { onTerminalState(JobStatus.FINISHED); } } } }
/** * Called whenever a vertex reaches state FINISHED (completed successfully). * Once all vertices are in the FINISHED state, the program is successfully done. */ void vertexFinished() { final int numFinished = verticesFinished.incrementAndGet(); if (numFinished == numVerticesTotal) { // done :-) // check whether we are still in "RUNNING" and trigger the final cleanup if (state == JobStatus.RUNNING) { // we do the final cleanup in the I/O executor, because it may involve // some heavier work try { for (ExecutionJobVertex ejv : verticesInCreationOrder) { ejv.getJobVertex().finalizeOnMaster(getUserClassLoader()); } } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); failGlobal(new Exception("Failed to finalize execution on master", t)); return; } // if we do not make this state transition, then a concurrent // cancellation or failure happened if (transitionState(JobStatus.RUNNING, JobStatus.FINISHED)) { onTerminalState(JobStatus.FINISHED); } } } }