{"record":{"id":"7f456f7d4a576a46","repo":"apache/iceberg","slug":"interrupted-in-call-to-check-view-existence-of-v","errorCode":null,"errorMessage":"Interrupted in call to check view existence of ${viewIdentifier}","messagePattern":"Interrupted in call to check view existence of (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java","lineNumber":523,"sourceCode":"  @Override\n  public boolean viewExists(TableIdentifier viewIdentifier) {\n    if (!isValidIdentifier(viewIdentifier)) {\n      return false;\n    }\n\n    String database = viewIdentifier.namespace().level(0);\n    String viewName = viewIdentifier.name();\n    try {\n      Table table = clients.run(client -> client.getTable(database, viewName));\n      HiveOperationsBase.validateTableIsIcebergView(table, fullTableName(name, viewIdentifier));\n      return true;\n    } catch (NoSuchIcebergViewException | NoSuchObjectException e) {\n      return false;\n    } catch (TException e) {\n      throw new RuntimeException(\"Failed to check view existence of \" + viewIdentifier, e);\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n      throw new RuntimeException(\n          \"Interrupted in call to check view existence of \" + viewIdentifier, e);\n    }\n  }\n\n  @Override\n  public void createNamespace(Namespace namespace, Map<String, String> meta) {\n    Preconditions.checkArgument(\n        !namespace.isEmpty(), \"Cannot create namespace with invalid name: %s\", namespace);\n    Preconditions.checkArgument(\n        isValidateNamespace(namespace),\n        \"Cannot support multi part namespace in Hive Metastore: %s\",\n        namespace);\n    Preconditions.checkArgument(\n        meta.get(HMS_DB_OWNER_TYPE) == null || meta.get(HMS_DB_OWNER) != null,\n        \"Create namespace setting %s without setting %s is not allowed\",\n        HMS_DB_OWNER_TYPE,\n        HMS_DB_OWNER);\n    try {","sourceCodeStart":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java#L505-L541","documentation":"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.","triggerScenarios":"viewExists during thread interruption — task cancellation, executor shutdown, or framework interrupts while the blocking metastore call is in flight.","commonSituations":"Cancelling a Spark/Flink job during view resolution; engine shutdown interrupting planner threads; timeouts on slow metastore calls.","solutions":["Identify the interruption source; on cancellation propagate shutdown instead of retrying.","Improve metastore responsiveness (network, pooling) to avoid watchdog interrupts.","Respect the restored interrupt flag in surrounding code — do not clear it and continue."],"exampleFix":"// before\nboolean exists = catalog.viewExists(viewId);\n// after\ntry {\n  boolean exists = catalog.viewExists(viewId);\n} catch (RuntimeException e) {\n  if (Thread.currentThread().isInterrupted()) {\n    throw new IllegalStateException(\"Cancelled during view existence check\", e);\n  }\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"if (Thread.currentThread().isInterrupted()) { throw new IllegalStateException(\"Interrupted before view existence check\"); }","typeGuard":null,"tryCatchPattern":"try { boolean ok = catalog.viewExists(viewId); } catch (RuntimeException e) { if (Thread.currentThread().isInterrupted()) { /* abort cleanly */ } throw e; }","preventionTips":["Never interpret interruption as 'view absent'","Honor the restored interrupt flag","Tune engine watchdog timeouts to exceed metastore latency"],"tags":["hive-metastore","view-exists","interrupted","cancellation"],"backgroundTag":"request-timeout","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}