[ 
https://issues.apache.org/jira/browse/THRIFT-3212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18110715#comment-18110715
 ] 

Volodymyr Panivko commented on THRIFT-3212:
-------------------------------------------

Current master already covers this case. The PHP cross-test matrix in 
test/tests.json includes json for the PHP client, test/php/protocols.php maps 
json to TJSONProtocolFactory, and the latest successful master Build run on 
2026-08-05 (GitHub Actions run 31001774415, cross-test job 92294458277) 
contains passing results for cpp-php json over http-ip, buffered-ip, and 
framed-ip, plus No unexpected failures. As of 2026-09-02 this issue appears 
stale-open, so I am closing it as Implemented.

> Fix make cross support for php TJSONProtocol
> --------------------------------------------
>
>                 Key: THRIFT-3212
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3212
>             Project: Thrift
>          Issue Type: Bug
>          Components: PHP - Library, Test Suite
>    Affects Versions: 0.9.2
>            Reporter: James E. King III
>            Assignee: Volodymyr Panivko
>            Priority: Minor
>
> After making changes to support json protocol for the php client in make 
> cross I found that it fails:
> {noformat}
> $ /usr/bin/python test/test.py -s --server cpp,,,,,,,,php,, --client 
> ,,,,,,,,php,,
> Apache Thrift - Integration Test Suite
> Mon Jun 29 17:24:49 2015
> ======================================================================
> server-client:     protocol:    transport:               result:
> cpp-php            binary       buffered-ip              success(0)
> cpp-php            compact      buffered-ip              success(0)
> cpp-php            compact      framed-ip                success(0)
> cpp-php            json         framed-ip                failure(255)
> cpp-php            json         buffered-ip              failure(255)
> ======================================================================
> *** Following 2 failures were unexpected ***:
> If it is introduced by you, please fix it before submitting the code.
> ======================================================================
> server-client:     protocol:    transport:               result:
> cpp-php            json         framed-ip                failure(255)
> cpp-php            json         buffered-ip              failure(255)
> ======================================================================
> Unexpected failures are logged to test/log/unexpected_failures.log
> {noformat}
> In the php client log it says:
> {noformat}
> Mon Jun 29 17:24:51 2015
> Executing: php TestClient.php --protocol=json --transport=buffered 
> --port=53492
> Directory: /home/jking/thrift/test/php
> config:delay: 2
> config:timeout: 6
> ======================================================================
> testVoid() = void
> testString("Test") = "Test"
> testByte(1) = 1
> testI32(-1) = -1
> testI64(-34359738368) = -34359738368
> testDouble(-852.234234234) = -852.234234234
> testStruct({"Zero", 1, -3, -5}) = {"Zero", 1, -3, -5}
> testNest({1, {"Zero", 1, -3, -5}), 5} = {1, {"Zero", 1, -3, -5}, 5}
> testMap({0 => -10, 1 => -9, 2 => -8, 3 => -7, 4 => -6}) = {0 => -10, 1 => -9, 
> 2 => -8, 3 => -7, 4 => -6}
> testSet({-2, -1, 0, 1, 2}) = {1, 1, 1, 1, 1}
> testList({-2, -1, 0, 1, 2}) = {-2, -1, 0, 1, 2}
> testEnum(ONE) = 1
> testEnum(TWO) = 2
> testEnum(THREE) = 3
> testEnum(FIVE) = 5
> testEnum(EIGHT) = 8
> testTypedef(309858235082523) = 309858235082523
> testMapMap(1) = {-4 => {-4 => -4, -3 => -3, -2 => -2, -1 => -1, }, 4 => {1 => 
> 1, 2 => 2, 3 => 3, 4 => 4, }, }
> testInsanity() = {1 => {2 => {{5 => 5, 8 => 8, }, {{"Goodbye4", 4, 4, 4}, 
> {"Hello2", 2, 2, 2}, }}, 3 => {{5 => 5, 8 => 8, }, {{"Goodbye4", 4, 4, 4}, 
> {"Hello2", 2, 2, 2}, }}, }, 2 => {6 => {{}, {}}, }, }
> testException('Xception') caught xception 1001: Xception
> Total time: 228 ms
> PHP Fatal error:  Uncaught exception 'Thrift\Exception\TTransportException' 
> with message 'TSocket read 0 bytes' in 
> /home/jking/thrift/lib/php/lib/Thrift/Transport/TSocket.php:278
> Stack trace:
> #0 /home/jking/thrift/lib/php/lib/Thrift/Transport/TTransport.php(75): 
> Thrift\Transport\TSocket->read(1)
> #1 
> /home/jking/thrift/lib/php/lib/Thrift/Transport/TBufferedTransport.php(118): 
> Thrift\Transport\TTransport->readAll(1)
> #2 
> /home/jking/thrift/lib/php/lib/Thrift/Protocol/JSON/LookaheadReader.php(41): 
> Thrift\Transport\TBufferedTransport->readAll(1)
> #3 /home/jking/thrift/lib/php/lib/Thrift/Protocol/TJSONProtocol.php(193): 
> Thrift\Protocol\JSON\LookaheadReader->read()
> #4 /home/jking/thrift/lib/php/lib/Thrift/Protocol/TJSONProtocol.php(466): 
> Thrift\Protocol\TJSONProtocol->readJSONSyntaxChar('[')
> #5 /home/jking/thrift/lib/php/lib/Thrift/Protocol/TJSONProtocol.php(622): 
> Thrift\Protocol\TJSONProtocol->readJSONArrayStart()
> #6 /home/jking/thrift/test/php/gen-php/ThriftTest/ThriftTest.php(483): 
> Thrift\Protocol\TJSONProtocol->readMessageBegin(NULL in 
> /home/jking/thrift/lib/php/lib/Thrift/Transport/TSocket.php on line 278
> ======================================================================
> Return code: 255
> Test execution took 0.4 seconds.
> {noformat}



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

Reply via email to