apache/iceberg · warning · UncheckedInterruptedException

Interrupted while listing schemas for scope

Error message

Interrupted while listing schemas for scope '%s'

What it means

JdbcSnowflakeClient.listSchemas wraps InterruptedException from the 'SHOW SCHEMAS' JDBC query into UncheckedInterruptedException, preserving the scope identifier in the message. It indicates the listing was cancelled by thread interruption, not that the scope is invalid or empty. SQLExceptions are handled separately via snowflakeExceptionToIcebergException.

Solutions

  1. Catch UncheckedInterruptedException and restore the interrupt status before unwinding
  2. Check and adjust the cancellation source (timeouts, speculative execution, shutdown ordering)
  3. Retry the listing after the environment stabilizes
  4. Break large listings into smaller scoped queries to shorten interruptible windows
Defensive patterns

Strategy: try-catch

Validate before calling

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

Try / catch

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

Prevention

When it happens

Trigger: Thread interrupted while executing the SHOW SCHEMAS query for the given scope — from engine task cancellation, executor shutdown, or timeouts interrupting worker threads.

Common situations: Spark/Flink task cancelled during namespace listing, Kubernetes pod termination mid-catalog-operation, or CLI tools interrupted by user Ctrl-C propagating interrupts to worker threads.

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/7d2be1d10b1afd64. Report an issue: GitHub.

Appendix: source

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

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

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

  @Override
  public List<SnowflakeIdentifier> listIcebergTables(SnowflakeIdentifier scope) {
    StringBuilder baseQuery = new StringBuilder("SHOW ICEBERG TABLES");
    String[] queryParams = null;
    switch (scope.type()) {
      case ROOT:

View on GitHub (pinned to 86d9c8fc54)