code: public void shutDown() throws FlinkException {
  
  		Exception exception = null;
  
  		try {
  			taskManagerStateStore.shutdown();
  		} catch (Exception e) {
  			exception = e;
  		}
  
  		try {
  			memoryManager.shutdown();
  		} catch (Exception e) {
  			exception = ExceptionUtils.firstOrSuppressed(e, exception);
  		}
  
  		try {
  			ioManager.shutdown();
  		} catch (Exception e) {
  			exception = ExceptionUtils.firstOrSuppressed(e, exception);
  		}
  
  		try {
  			networkEnvironment.shutdown();
  		} catch (Exception e) {
  			exception = ExceptionUtils.firstOrSuppressed(e, exception);
  		}
  
  		try {
  			kvStateService.shutdown();
  		} catch (Exception e) {
  			exception = ExceptionUtils.firstOrSuppressed(e, exception);
  		}
  
  		try {
  			taskSlotTable.stop();
  		} catch (Exception e) {
  			exception = ExceptionUtils.firstOrSuppressed(e, exception);
  		}
  
  		try {
  			jobLeaderService.stop();
  		} catch (Exception e) {
  			exception = ExceptionUtils.firstOrSuppressed(e, exception);
  		}
  
  		taskEventDispatcher.clearAll();
  
  		if (exception != null) {
  			throw new FlinkException("Could not properly shut down the TaskManager services.", exception);
  		}
  	}
docs: Shuts the {@link TaskExecutor} services down.