dongjoon-hyun commented on code in PR #57677:
URL: https://github.com/apache/spark/pull/57677#discussion_r3696832602
##########
core/src/main/java/org/apache/spark/security/CredentialProvider.java:
##########
@@ -101,4 +101,20 @@ public interface CredentialProvider {
default Duration suggestedTtl() {
return Duration.ofMinutes(15);
}
+
+ /**
+ * Releases any resources held by this provider (e.g., HTTP clients,
connection pools).
+ * <p>
+ * Called by the credential management layer during shutdown. The default
implementation
+ * is a no-op; providers that allocate long-lived resources in {@link
#init(Map)} should
+ * override this method to clean them up.
+ * <p>
Review Comment:
`stop()` calls `shutdownNow()` (interrupt only, no wait) and then
`closeAll()` immediately, so `close()` can run while a renewal task is still
inside `resolve()`. Since this is an SPI, that concurrency contract should be
spelled out for implementors:
```suggestion
* <p>
* {@code close()} may be invoked while another thread is still executing
* {@link #resolve(UserContext, URI)}: shutdown interrupts the renewal
thread but does
* not wait for in-flight calls to complete. Implementations must tolerate
a concurrent
* or subsequent {@code resolve()} failing after resources have been
released, and
* {@code close()} itself must not block indefinitely.
* <p>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]