public List<Operation> removeExpiredOperations(OperationHandle[] handles) {
    List<Operation> removed = new ArrayList<Operation>();
    for (OperationHandle handle : handles) {
      Operation operation = removeTimedOutOperation(handle);
      if (operation != null) {
        LOG.warn("Operation " + handle + " is timed-out and will be closed");
        removed.add(operation);
      }
    }
    return removed;
  }
Cancel the running operation unless it is already in a terminal state
@param opHandle
@throws HiveSQLException
service/src/java/org/apache/hive/service/cli/operation/OperationManager.java