apache/iceberg · error · RuntimeException

Interrupted in call to check view existence of

Error message

Interrupted in call to check view existence of ${viewIdentifier}

What it means

Thrown when the thread is interrupted while HiveCatalog.viewExists waits for the metastore getTable call. Iceberg re-asserts the interrupt flag and throws this RuntimeException. The view's existence remains unknown to the caller.

Solutions

  1. Identify the interruption source; on cancellation propagate shutdown instead of retrying.
  2. Improve metastore responsiveness (network, pooling) to avoid watchdog interrupts.
  3. Respect the restored interrupt flag in surrounding code — do not clear it and continue.

Example fix

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

Strategy: try-catch

Validate before calling

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

Try / catch

try { boolean ok = catalog.viewExists(viewId); } catch (RuntimeException e) { if (Thread.currentThread().isInterrupted()) { /* abort cleanly */ } throw e; }

Prevention

When it happens

Trigger: viewExists during thread interruption — task cancellation, executor shutdown, or framework interrupts while the blocking metastore call is in flight.

Common situations: Cancelling a Spark/Flink job during view resolution; engine shutdown interrupting planner threads; timeouts on slow metastore calls.

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

Appendix: source

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

  @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;
    } catch (TException e) {
      throw new RuntimeException("Failed to check view existence of " + viewIdentifier, e);
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new RuntimeException(
          "Interrupted in call to check view existence of " + viewIdentifier, e);
    }
  }

  @Override
  public void createNamespace(Namespace namespace, Map<String, String> meta) {
    Preconditions.checkArgument(
        !namespace.isEmpty(), "Cannot create namespace with invalid name: %s", namespace);
    Preconditions.checkArgument(
        isValidateNamespace(namespace),
        "Cannot support multi part namespace in Hive Metastore: %s",
        namespace);
    Preconditions.checkArgument(
        meta.get(HMS_DB_OWNER_TYPE) == null || meta.get(HMS_DB_OWNER) != null,
        "Create namespace setting %s without setting %s is not allowed",
        HMS_DB_OWNER_TYPE,
        HMS_DB_OWNER);
    try {

View on GitHub (pinned to 86d9c8fc54)