{"record":{"id":"7d2be1d10b1afd64","repo":"apache/iceberg","slug":"interrupted-while-listing-schemas-for-scope-s","errorCode":null,"errorMessage":"Interrupted while listing schemas for scope '%s'","messagePattern":"Interrupted while listing schemas for scope '(.+?)'","errorType":"exception","errorClass":"UncheckedInterruptedException","httpStatus":null,"severity":"warning","filePath":"snowflake/src/main/java/org/apache/iceberg/snowflake/JdbcSnowflakeClient.java","lineNumber":268,"sourceCode":"      default:\n        throw new IllegalArgumentException(\n            String.format(\"Unsupported scope type for listSchemas: %s\", scope));\n    }\n\n    final String finalQuery = baseQuery.toString();\n    final String[] finalQueryParams = queryParams;\n    List<SnowflakeIdentifier> schemas;\n    try {\n      schemas =\n          connectionPool.run(\n              conn ->\n                  queryHarness.query(\n                      conn, finalQuery, SCHEMA_RESULT_SET_HANDLER, finalQueryParams));\n    } catch (SQLException e) {\n      throw snowflakeExceptionToIcebergException(\n          scope, e, String.format(\"Failed to list schemas for scope '%s'\", scope));\n    } catch (InterruptedException e) {\n      throw new UncheckedInterruptedException(\n          e, \"Interrupted while listing schemas for scope '%s'\", scope);\n    }\n    schemas.forEach(\n        schema ->\n            Preconditions.checkState(\n                schema.type() == SnowflakeIdentifier.Type.SCHEMA,\n                \"Expected SCHEMA, got identifier '%s' for scope '%s'\",\n                schema,\n                scope));\n    return schemas;\n  }\n\n  @Override\n  public List<SnowflakeIdentifier> listIcebergTables(SnowflakeIdentifier scope) {\n    StringBuilder baseQuery = new StringBuilder(\"SHOW ICEBERG TABLES\");\n    String[] queryParams = null;\n    switch (scope.type()) {\n      case ROOT:","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/snowflake/src/main/java/org/apache/iceberg/snowflake/JdbcSnowflakeClient.java#L250-L286","documentation":"JdbcSnowflakeClient.listSchemas wraps InterruptedException from the 'SHOW SCHEMAS' JDBC query into UncheckedInterruptedException, preserving the scope identifier in the message. It indicates the listing was cancelled by thread interruption, not that the scope is invalid or empty. SQLExceptions are handled separately via snowflakeExceptionToIcebergException.","triggerScenarios":"Thread interrupted while executing the SHOW SCHEMAS query for the given scope — from engine task cancellation, executor shutdown, or timeouts interrupting worker threads.","commonSituations":"Spark/Flink task cancelled during namespace listing, Kubernetes pod termination mid-catalog-operation, or CLI tools interrupted by user Ctrl-C propagating interrupts to worker threads.","solutions":["Catch UncheckedInterruptedException and restore the interrupt status before unwinding","Check and adjust the cancellation source (timeouts, speculative execution, shutdown ordering)","Retry the listing after the environment stabilizes","Break large listings into smaller scoped queries to shorten interruptible windows"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (Thread.currentThread().isInterrupted()) {\n  throw new InterruptedException(\"Interrupted before listSchemas call\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  client.listSchemas(scope);\n} catch (UncheckedInterruptedException e) {\n  Thread.currentThread().interrupt();\n  throw e;\n}","preventionTips":["Restore the interrupt flag when catching this exception","Avoid issuing schema listings during shutdown windows","Use schema-scoped queries rather than account-wide ones to shorten exposure","Monitor for repeated interruptions indicating premature cancellation policies"],"tags":["snowflake","interruption","threading"],"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"}