Repository navigation
Conversation
Client: php Keep curl options and handle cleanup local to each client. Add regression coverage for independent timeout settings, handle reuse and cleanup. Apache JIRA ticket pending; this change is prepared as a draft. Generated-by: Codex (GPT-6)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TCurlClient instances currently share a static curl handle. If client A sets a 100 ms timeout, a new client B with no timeout inherits it: a response that arrives after 350 ms fails after about 100 ms. The connection timeout is shared in the same way.
Give each client its own reusable curl handle. Closing a client or handling a failed transfer releases only that client's handle. Remove the global shutdown callback so PHP can release the handle with its owning object.
JIRA: THRIFT-6370
Task: PHP: Give each TCurlClient its own curl handle
Acceptance criteria:
Compatibility:
closeCurlHandle()becomes an instance method. ReplaceTCurlClient::closeCurlHandle()with$client->closeCurlHandle(), or use$client->close()to release its handle and clear its buffers. The PHP README documents this change. Connections are reused within a client instance rather than shared across instances.Validation on PHP 8.2.30 with PHPUnit 10.5.65:
TCurlClientTestcases and 4TCurlClientRedirectTestcases pass after the change.git diff --checkis clean.make stylewas attempted but is unavailable in the unconfigured worktree (No rule to make target 'style').Implementation and regression tests were AI-assisted.
Generated-by: Codex (GPT-6)