apache/iceberg · error · RuntimeException

Interrupted in call to dropView

Error message

Interrupted in call to dropView

What it means

dropView() catches InterruptedException, restores the interrupt flag, and rethrows a RuntimeException with this message. The thread was interrupted while the metastore view-drop RPC was running, leaving the drop outcome indeterminate.

Source

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

          client -> {
            client.dropTable(database, viewName, false, false);
            return null;
          });

      if (lastViewMetadata != null) {
        CatalogUtil.dropViewMetadata(ops.io(), lastViewMetadata);
      }

      LOG.info("Dropped view: {}", identifier);
      return true;
    } catch (NoSuchObjectException e) {
      LOG.info("Skipping drop, view does not exist: {}", identifier, e);
      return false;
    } catch (TException e) {
      throw new RuntimeException("Failed to drop view " + identifier, e);
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new RuntimeException("Interrupted in call to dropView", e);
    }
  }

  @Override
  public void renameTable(TableIdentifier from, TableIdentifier originalTo) {
    renameTableOrView(from, originalTo, HiveOperationsBase.ContentType.TABLE);
  }

  @Override
  public void renameView(TableIdentifier from, TableIdentifier to) {
    renameTableOrView(from, to, HiveOperationsBase.ContentType.VIEW);
  }

  private List<TableIdentifier> listIcebergTables(
      List<String> tableNames, Namespace namespace, String tableTypeProp)
      throws TException, InterruptedException {
    List<Table> tableObjects =
        clients.run(client -> client.getTableObjectsByName(namespace.level(0), tableNames));

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Re-check view existence at the metastore to learn whether the drop landed.
  2. Propagate the interrupt/cancellation instead of swallowing it.
  3. Fix the source of interruption (shutdown ordering, timeouts) if unintended.
  4. Retry only after the interruption source is gone.

Example fix

// before
try { catalog.dropView(v); } catch (RuntimeException e) { LOG.warn("dropped?", e); }
// after
try {
  catalog.dropView(v);
} catch (RuntimeException e) {
  if (e.getCause() instanceof InterruptedException) {
    Thread.currentThread().interrupt();
  }
  throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

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

Try / catch

try {
  catalog.dropView(viewId);
} catch (RuntimeException e) {
  if (e.getCause() instanceof InterruptedException) {
    Thread.currentThread().interrupt();
    throw e;
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling catalog.dropView(identifier) from a thread interrupted during the Thrift metastore call (task cancellation, pool shutdown, kill).

Common situations: Cancelling a Spark/Flink job cleaning up views; executor shutdown mid-cleanup; timeouts implemented via interrupt.

Related errors


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