{"record":{"id":"da5619461a5a4150","repo":"apache/iceberg","slug":"interrupted-during-refresh","errorCode":null,"errorMessage":"Interrupted during refresh","messagePattern":"Interrupted during refresh","errorType":"exception","errorClass":"UncheckedInterruptedException","httpStatus":null,"severity":"warning","filePath":"core/src/main/java/org/apache/iceberg/jdbc/JdbcTableOperations.java","lineNumber":76,"sourceCode":"      Map<String, String> catalogProperties,\n      JdbcUtil.SchemaVersion schemaVersion) {\n    this.catalogName = catalogName;\n    this.tableIdentifier = tableIdentifier;\n    this.fileIO = fileIO;\n    this.connections = dbConnPool;\n    this.catalogProperties = catalogProperties;\n    this.schemaVersion = schemaVersion;\n  }\n\n  @Override\n  public void doRefresh() {\n    Map<String, String> table;\n\n    try {\n      table = JdbcUtil.loadTable(schemaVersion, connections, catalogName, tableIdentifier);\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n      throw new UncheckedInterruptedException(e, \"Interrupted during refresh\");\n    } catch (SQLException e) {\n      // SQL exception happened when getting table from catalog\n      throw new UncheckedSQLException(\n          e, \"Failed to get table %s from catalog %s\", tableIdentifier, catalogName);\n    }\n\n    if (table.isEmpty()) {\n      if (currentMetadataLocation() != null) {\n        throw new NoSuchTableException(\n            \"Failed to load table %s from catalog %s: dropped by another process\",\n            tableIdentifier, catalogName);\n      } else {\n        this.disableRefresh();\n        return;\n      }\n    }\n\n    String newMetadataLocation = table.get(METADATA_LOCATION_PROP);","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/jdbc/JdbcTableOperations.java#L58-L94","documentation":"Thrown when the thread is interrupted while loading the current table metadata from the JDBC catalog during refresh. The interrupt flag is re-set before throwing UncheckedInterruptedException. It means a table refresh was cancelled, usually by task cancellation or shutdown.","triggerScenarios":"JdbcTableOperations.doRefresh() calls JdbcUtil.loadTable(...), which acquires a pooled connection and runs a query; an InterruptedException from pool acquisition (thread interrupted) triggers it.","commonSituations":"Spark/Flink task cancellation during query execution, executor shutdown while refresh is in flight, application kill/cancel during catalog access.","solutions":["Investigate what interrupted the thread (task cancellation, shutdown hook) and whether cancellation was intended.","Retry the operation in a fresh, non-interrupted thread if cancellation was spurious.","Avoid long-blocking operations before refresh that increase the interruption window.","Check pool exhaustion — threads waiting long on connections are more likely to be interrupted by timeouts."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  table.refresh();\n} catch (UncheckedInterruptedException e) {\n  Thread.currentThread().interrupt(); // preserve interrupt status\n  // abort or reschedule the refresh\n}","preventionTips":["Preserve interrupt status when catching InterruptedException.","Avoid interrupting worker threads during table commits/refreshes except for genuine cancellation.","Check pool wait times; long waits increase cancellation exposure."],"tags":["jdbc","interruption","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-14T16:17:12.679Z"}