{"record":{"id":"cee6f95011c783e6","repo":"apache/iceberg","slug":"failed-to-close-the-vendedadlscredentialprovider","errorCode":null,"errorMessage":"Failed to close the VendedAdlsCredentialProvider","messagePattern":"Failed to close the VendedAdlsCredentialProvider","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"warning","filePath":"azure/src/main/java/org/apache/iceberg/azure/adlsv2/VendedAdlsCredentialProvider.java","lineNumber":199,"sourceCode":"\n  private void checkCredential(Credential credential, String property) {\n    Preconditions.checkState(\n        credential.config().containsKey(property),\n        \"Invalid ADLS Credentials: %s not set\",\n        property);\n  }\n\n  @Override\n  public void close() {\n    CloseableGroup closeableGroup = new CloseableGroup();\n    closeableGroup.addCloseable(authSession);\n    closeableGroup.addCloseable(authManager);\n    closeableGroup.addCloseable(client);\n    closeableGroup.setSuppressCloseFailure(true);\n    try {\n      closeableGroup.close();\n    } catch (IOException e) {\n      throw new UncheckedIOException(\"Failed to close the VendedAdlsCredentialProvider\", e);\n    }\n  }\n}\n","sourceCodeStart":181,"sourceCodeEnd":203,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/azure/src/main/java/org/apache/iceberg/azure/adlsv2/VendedAdlsCredentialProvider.java#L181-L203","documentation":"VendedAdlsCredentialProvider.close() closes its CloseableGroup (auth manager and client); if closing throws an IOException it is rethrown as this UncheckedIOException. Failures are suppressed per-sub-closeable where possible (setSuppressCloseFailure(true)), so this usually means multiple or unrecoverable close failures.","triggerScenarios":"Calling close() on the VendedAdlsCredentialProvider when the underlying OAuth token fetcher/auth manager or Azure client fails to shut down cleanly.","commonSituations":"Shutdown during active token refresh; I/O errors during client teardown; resource cleanup in error paths after initialization partially failed.","solutions":["Inspect the wrapped IOException cause to identify which component failed to close.","Ensure token refresh threads are stopped before closing the provider.","If thrown during application shutdown, log and continue; it is rarely recoverable, but check for leaked connections/threads in subsequent runs."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { provider.close(); } catch (UncheckedIOException e) { log.warn(\"VendedAdlsCredentialProvider close failed: {}\", e.getCause().toString()); }","preventionTips":["Close the provider during orderly application shutdown only.","Stop background token refresh activity before closing.","Treat close failures as warnings; investigate cause but do not block shutdown."],"tags":["azure","adls","resource-cleanup","close"],"backgroundTag":"http-request-failed","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"}