{"record":{"id":"de862c226f29acdc","repo":"apache/iceberg","slug":"interrupted-in-call-to-droptable","errorCode":null,"errorMessage":"Interrupted in call to dropTable","messagePattern":"Interrupted in call to dropTable","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java","lineNumber":290,"sourceCode":"          });\n\n      if (purge && lastMetadata != null) {\n        CatalogUtil.dropTableData(ops.io(), lastMetadata);\n      }\n\n      LOG.info(\"Dropped table: {}\", identifier);\n      return true;\n\n    } catch (NoSuchTableException | NoSuchObjectException e) {\n      LOG.info(\"Skipping drop, table does not exist: {}\", identifier, e);\n      return false;\n\n    } catch (TException e) {\n      throw new RuntimeException(\"Failed to drop \" + identifier, e);\n\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n      throw new RuntimeException(\"Interrupted in call to dropTable\", e);\n    }\n  }\n\n  @Override\n  public boolean dropView(TableIdentifier identifier) {\n    if (!isValidIdentifier(identifier)) {\n      return false;\n    }\n\n    try {\n      String database = identifier.namespace().level(0);\n      String viewName = identifier.name();\n\n      HiveViewOperations ops = (HiveViewOperations) newViewOps(identifier);\n      ViewMetadata lastViewMetadata = null;\n      try {\n        lastViewMetadata = ops.current();\n      } catch (NotFoundException e) {","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java#L272-L308","documentation":"dropTable() catches InterruptedException, re-interrupts the thread, and rethrows a RuntimeException with this message. It means the thread was interrupted while the metastore drop RPC was in progress, so the table's drop outcome is unknown.","triggerScenarios":"Calling catalog.dropTable(identifier) from a thread that receives an interrupt (executor shutdown, task cancellation, kill) during the Thrift call to the metastore.","commonSituations":"Cancelling Spark/Flink jobs that drop staging tables; shutting down worker pools mid-cleanup; deadline-based cancellation implemented with interrupts.","solutions":["Verify the table's actual state afterwards — the drop may or may not have completed at the metastore.","Let the interrupt propagate; do not swallow it after restoring the flag.","Adjust executor shutdown/cancellation flow if interruption during cleanup is unintended.","Retry the drop only after confirming the interruption source has stopped."],"exampleFix":"// before\ntry { catalog.dropTable(id); } catch (RuntimeException e) { /* ignored */ }\n// after\ntry {\n  catalog.dropTable(id);\n} catch (RuntimeException e) {\n  if (e.getCause() instanceof InterruptedException) {\n    Thread.currentThread().interrupt();\n    throw e;\n  }\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"if (Thread.currentThread().isInterrupted()) {\n  throw new InterruptedException(\"Interrupted before dropping table\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  catalog.dropTable(id);\n} catch (RuntimeException e) {\n  if (e.getCause() instanceof InterruptedException) {\n    Thread.currentThread().interrupt();\n    // defer: re-check table existence later before retrying\n    throw e;\n  }\n  throw e;\n}","preventionTips":["After interruption, re-verify table state before retrying the drop.","Avoid killing threads mid-metadata-operation; use idempotent cleanup jobs.","Ensure shutdown hooks let in-flight metastore calls finish or abort cleanly."],"tags":["hive-metastore","interruption","threading","drop-table"],"backgroundTag":"thread-interrupted","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}