apache/iceberg · warning · UncheckedInterruptedException

Interrupted while listing tables for scope

Error message

Interrupted while listing tables for scope '%s'

What it means

JdbcSnowflakeClient.listIcebergTables wraps InterruptedException raised during the Iceberg-tables listing JDBC query into UncheckedInterruptedException, including the scope in the message. The listing was cancelled by thread interruption; SQLExceptions are converted separately via snowflakeExceptionToIcebergException.

Solutions

  1. Handle UncheckedInterruptedException by restoring the interrupt flag and aborting cleanly
  2. Tune the cancellation source (increase timeouts, disable speculative execution, orderly shutdown)
  3. Retry the listing after confirming cancellation was not intentional
  4. Scope listings narrowly (schema-level) to minimize interruption exposure
Defensive patterns

Strategy: try-catch

Validate before calling

if (Thread.currentThread().isInterrupted()) {
  throw new InterruptedException("Interrupted before listIcebergTables call");
}

Try / catch

try {
  client.listIcebergTables(scope);
} catch (UncheckedInterruptedException e) {
  Thread.currentThread().interrupt();
  throw e;
}

Prevention

When it happens

Trigger: Thread interrupted while the SHOW TABLES/ICEBERG TABLES query for the given scope runs — due to task cancellation, executor shutdownNow, or timeout-driven interrupts in the query harness.

Common situations: Spark/Flink job cancellation during table listing, service shutdown with catalog calls in flight, or long-running account-wide listings getting interrupted by timeout policies.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/d505bbce22d36138. Report an issue: GitHub.

Appendix: source

Thrown at snowflake/src/main/java/org/apache/iceberg/snowflake/JdbcSnowflakeClient.java:317

        break;
      default:
        throw new IllegalArgumentException(
            String.format("Unsupported scope type for listIcebergTables: %s", scope));
    }

    final String finalQuery = baseQuery.toString();
    final String[] finalQueryParams = queryParams;
    List<SnowflakeIdentifier> tables;
    try {
      tables =
          connectionPool.run(
              conn ->
                  queryHarness.query(conn, finalQuery, TABLE_RESULT_SET_HANDLER, finalQueryParams));
    } catch (SQLException e) {
      throw snowflakeExceptionToIcebergException(
          scope, e, String.format("Failed to list tables for scope '%s'", scope));
    } catch (InterruptedException e) {
      throw new UncheckedInterruptedException(
          e, "Interrupted while listing tables for scope '%s'", scope);
    }
    tables.forEach(
        table ->
            Preconditions.checkState(
                table.type() == SnowflakeIdentifier.Type.TABLE,
                "Expected TABLE, got identifier '%s' for scope '%s'",
                table,
                scope));
    return tables;
  }

  @Override
  public SnowflakeTableMetadata loadTableMetadata(SnowflakeIdentifier tableIdentifier) {
    Preconditions.checkArgument(
        tableIdentifier.type() == SnowflakeIdentifier.Type.TABLE,
        "loadTableMetadata requires a TABLE identifier, got '%s'",
        tableIdentifier);

View on GitHub (pinned to 86d9c8fc54)