Volodymyr Panivko created THRIFT-6370:
-----------------------------------------

             Summary: PHP: Give each TCurlClient its own curl handle
                 Key: THRIFT-6370
                 URL: https://issues.apache.org/jira/browse/THRIFT-6370
             Project: Thrift
          Issue Type: Bug
          Components: PHP - Library
            Reporter: Volodymyr Panivko


TCurlClient instances share a static curl handle, so curl options and handle 
cleanup can affect other clients.

For example, after client A sends a request with a 100 ms timeout, a new client 
B with no timeout inherits A's setting. B then fails after about 100 ms even 
when its response would arrive after 350 ms. The connection timeout is shared 
in the same way.

Give each TCurlClient its own reusable curl handle. Closing a client or 
handling a failed transfer should release only that client's handle. Remove the 
global shutdown callback and allow PHP to release the handle with its owning 
object.

Acceptance criteria:
* Timeout and connection-timeout settings do not carry over between client 
instances.
* 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.
* Regression tests cover isolation, reuse and cleanup; the PHP README documents 
the compatibility change.

Compatibility: closeCurlHandle() becomes an instance method. Replace 
TCurlClient::closeCurlHandle() with $client->closeCurlHandle(), or use 
$client->close() to release the handle and clear the buffers. Connections are 
reused within a client instance instead of being shared across instances.

Draft implementation and regression tests: 
https://github.com/apache/thrift/pull/3947

Generated-by: Codex (GPT-6)




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to