sveneld opened a new pull request, #3947:
URL: https://github.com/apache/thrift/pull/3947

   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 pending:** this draft also contains the task description because 
GitHub Issues are disabled in `apache/thrift` and in the contributor's fork. An 
Apache JIRA THRIFT ticket is still required before this change is ready for 
merge; add its identifier to the branch, commit and PR title when available.
   
   Task: PHP: Give each TCurlClient its own curl handle
   
   Acceptance criteria:
   
   - Timeout and connection-timeout settings do not carry over to another 
client.
   - Repeated requests reuse the owning client's handle.
   - Closing a client or failing its request leaves other clients' handles 
usable.
   - A subsequent request recreates a released handle.
   
   Compatibility: `closeCurlHandle()` becomes an instance method. Replace 
`TCurlClient::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:
   
   - The new timeout-isolation regression test failed before the implementation 
change, showing B using A's handle and both timeout settings.
   - All 35 `TCurlClientTest` cases and 4 `TCurlClientRedirectTest` cases pass 
after the change.
   - PHPCS passes for the changed PHP files; `git diff --check` is clean.
   - `make style` was 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)
   


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