public void cleanupQueryExecution(
      Long queryId, org.apache.thrift.TBase<?, ?> nativeApiRequest, Throwable t) {
    IQueryExecution queryExecution = getQueryExecution(queryId);
    if (queryExecution != null) {
      try (SetThreadName threadName = new SetThreadName(queryExecution.getQueryId())) {
        LOGGER.debug("[CleanUpQuery]]");
        queryExecution.stopAndCleanup(t);
        queryExecutionMap.remove(queryId);
        if (queryExecution.isQuery() && queryExecution.isUserQuery()) {
          long costTime = queryExecution.getTotalExecutionTime();
          // print slow query
          if (costTime / 1_000_000 >= CONFIG.getSlowQueryThreshold()) {
            SLOW_SQL_LOGGER.info(
                "Cost: {} ms, {}",
                costTime / 1_000_000,
                getContentOfRequest(nativeApiRequest, queryExecution));
          }

          // only sample successful query
          if (t == null && COMMON_CONFIG.isEnableQuerySampling()) { // sampling is enabled
            String queryRequest = getContentOfRequest(nativeApiRequest, queryExecution);
            if (COMMON_CONFIG.isQuerySamplingHasRateLimit()) {
              if (COMMON_CONFIG.getQuerySamplingRateLimiter().tryAcquire(queryRequest.length())) {
                SAMPLED_QUERIES_LOGGER.info(queryRequest);
              }
            } else {
              // no limit, always sampled
              SAMPLED_QUERIES_LOGGER.info(queryRequest);
            }
          }
        }
      }
    }
  }
This method is called by the write method. So it does not set the timeout parameter.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java