apache/iceberg · error · RuntimeException

Interrupted in call to check table existence of

Error message

Interrupted in call to check table existence of ${baseTableIdentifier}

What it means

Thrown when the thread is interrupted while HiveCatalog.tableExists waits on the metastore getTable call. Iceberg restores the interrupt status and throws this RuntimeException. No existence answer is returned, so callers must treat the state as unknown.

Solutions

  1. Re-run the existence check after understanding the interruption source (cancellation usually means you should abort, not retry).
  2. Reduce metastore call latency (network, connection pool sizing) so calls complete before watchdog interrupts.
  3. Preserve and respect the interrupt flag in calling code rather than suppressing it.

Example fix

// before
boolean exists = catalog.tableExists(identifier);
// after
try {
  boolean exists = catalog.tableExists(identifier);
} catch (RuntimeException e) {
  if (Thread.currentThread().isInterrupted()) {
    throw new IllegalStateException("Cancelled during existence check", e);
  }
  throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (Thread.currentThread().isInterrupted()) { throw new IllegalStateException("Interrupted before existence check"); }

Try / catch

try { boolean ok = catalog.tableExists(id); } catch (RuntimeException e) { if (Thread.currentThread().isInterrupted()) { /* abort: state unknown */ } throw e; }

Prevention

When it happens

Trigger: tableExists (directly or via renameTableOrView/registerTable) during thread interruption — job cancellation, executor shutdown, or interruption during a slow metastore call.

Common situations: Spark/Flink task cancellation during planning; shutdown hooks interrupting worker threads; framework watchdogs interrupting long metastore waits.

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

Appendix: source

Thrown at hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java:500

        return false;
      } else {
        baseTableIdentifier = TableIdentifier.of(identifier.namespace().levels());
      }
    }

    String database = baseTableIdentifier.namespace().level(0);
    String tableName = baseTableIdentifier.name();
    try {
      Table table = clients.run(client -> client.getTable(database, tableName));
      HiveOperationsBase.validateTableIsIceberg(table, fullTableName(name, baseTableIdentifier));
      return true;
    } catch (NoSuchTableException | NoSuchObjectException e) {
      return false;
    } catch (TException e) {
      throw new RuntimeException("Failed to check table existence of " + baseTableIdentifier, e);
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new RuntimeException(
          "Interrupted in call to check table existence of " + baseTableIdentifier, e);
    }
  }

  @Override
  public boolean viewExists(TableIdentifier viewIdentifier) {
    if (!isValidIdentifier(viewIdentifier)) {
      return false;
    }

    String database = viewIdentifier.namespace().level(0);
    String viewName = viewIdentifier.name();
    try {
      Table table = clients.run(client -> client.getTable(database, viewName));
      HiveOperationsBase.validateTableIsIcebergView(table, fullTableName(name, viewIdentifier));
      return true;
    } catch (NoSuchIcebergViewException | NoSuchObjectException e) {
      return false;

View on GitHub (pinned to 86d9c8fc54)