You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WorkloadIdentityHttpClient can leak its delegate when auth cleanup throws #882
If the configured workload-identity provider throws from close(), execution never reaches delegate.close().
This differs from the sibling AuthenticatingHttpClient, which deliberately attempts both cleanup operations and preserves the first failure while suppressing a second one.
Impact
A custom SubjectTokenProvider may implement AutoCloseable and fail during cleanup. In that case the underlying HTTP client can remain open, retaining transports, connection pools, executors, or other resources.
Expected behavior
Closing the wrapper should always attempt to close both owned resources. If both fail, the first failure should be propagated and the second retained as a suppressed exception.
Suggested fix
Use the same failure-preserving cleanup pattern already used by AuthenticatingHttpClient, with workload-identity cleanup attempted first and delegate cleanup guaranteed afterward.
Add regression coverage for:
auth cleanup fails, delegate still closes;
both cleanup operations fail, delegate failure is suppressed on the auth failure;
Activity