jiangxt2 opened a new pull request, #13741:
URL: https://github.com/apache/gravitino/pull/13741

   ### What changes were proposed in this pull request?
   
   - Remove the unsupported HTTP `CLOSE` request from `HTTPClient.close()`.
   - Make close local and idempotent after success: call the authentication 
data provider without an HTTP request, skip cleanup on repeated successful 
calls, and propagate failures so callers can retry.
   - Add regression tests for `HTTPClient`, the public `GravitinoClient`, and 
`OAuth2TokenProvider` delegation.
   
   ### Why are the changes needed?
   
   The bug is that `HTTPClient.close()` sends an unsupported `CLOSE /` request 
before closing the authentication provider. The request can fail when the 
server does not implement `CLOSE` or is unavailable, preventing local 
authentication cleanup.
   
   Fix: #13736
   
   ### Does this PR introduce any user-facing change?
   
   Yes. Python client `close()` no longer sends an HTTP request and is safe to 
call repeatedly after successful cleanup. The public method signature is 
unchanged.
   
   ### How was this patch tested?
   
   - From `clients/client-python/tests/unittests`, `PYTHONPATH=../.. coverage 
run --branch -m unittest` passed 1,185 tests.
   - From the same directory, `PYTHONPATH=../.. python -m unittest -v 
auth.test_oauth2_token_provider.TestOAuth2TokenProvider.test_close_delegates_without_request`
 passed.
   - Ruff and Black checks passed on the four changed Python files.
   - A local Docker regression against a `2.0.0-SNAPSHOT` server verified 
successful `GET /api/version` responses, no `CLOSE` requests, and one provider 
cleanup when the server was available and after it stopped.
   - Full OAuth service integration is not covered.
   
   


-- 
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]

Reply via email to