// This is problematic as the user code class loader is not
// available at this point.
@Override
	public void shutdown() throws Exception {
		synchronized (shutDownLock) {
			// This is problematic as the user code class loader is not
			// available at this point.
			for (Savepoint savepoint : savepoints.values()) {
				try {
					savepoint.dispose();
				} catch (Throwable t) {
					LOG.warn("Failed to dispose savepoint " + savepoint.getCheckpointId(), t);
				}
			}
			savepoints.clear();
			// Remove shutdown hook to prevent resource leaks, unless this is
			// invoked by the shutdown hook itself.
			if (shutdownHook != null && shutdownHook != Thread.currentThread()) {
				try {
					Runtime.getRuntime().removeShutdownHook(shutdownHook);
				} catch (IllegalStateException ignored) {
					// Race, JVM is in shutdown already, we can safely ignore this
				} catch (Throwable t) {
					LOG.warn("Failed to unregister shut down hook.");
				}
			}
			shutDown = true;
		}
	}
public void shutdown() throws Exception {
synchronized (shutDownLock) {
// This is problematic as the user code class loader is not
// available at this point.
for (Savepoint savepoint : savepoints.values()) {
try {
@Override
public void shutdown() throws Exception {
synchronized (shutDownLock) {
// This is problematic as the user code class loader is not
// available at this point.
for (Savepoint savepoint : savepoints.values()) {
try {
savepoint.dispose();
} catch (Throwable t) {
LOG.warn("Failed to dispose savepoint " + savepoint.getCheckpointId(), t);
}
}
savepoints.clear();
// Remove shutdown hook to prevent resource leaks, unless this is
// invoked by the shutdown hook itself.
@Override
public void shutdown() throws Exception {
synchronized (shutDownLock) {
// This is problematic as the user code class loader is not
// available at this point.
for (Savepoint savepoint : savepoints.values()) {
try {
savepoint.dispose();
} catch (Throwable t) {
LOG.warn("Failed to dispose savepoint " + savepoint.getCheckpointId(), t);
}
}
savepoints.clear();
// Remove shutdown hook to prevent resource leaks, unless this is
// invoked by the shutdown hook itself.
if (shutdownHook != null && shutdownHook != Thread.currentThread()) {
try {
Runtime.getRuntime().removeShutdownHook(shutdownHook);
} catch (IllegalStateException ignored) {
// Race, JVM is in shutdown already, we can safely ignore this
} catch (Throwable t) {
LOG.warn("Failed to unregister shut down hook.");
}
}
shutDown = true;