Github user sstach commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1093#discussion_r80425129
  
    --- Diff: lib/php/lib/Thrift/Protocol/TBinaryProtocol.php ---
    @@ -246,6 +257,10 @@ public function readMessageBegin(&$name, &$type, 
&$seqid)
           }
         }
     
    +    if ($seqid != $this->seqid_) {
    +      throw new TApplicationException("TBinaryProtocol::ReadMessageBegin 
received SequenceID: $seqid not matches requested ID: $this->seqid_ " . 
TApplicationException::BAD_SEQUENCE_ID);
    +    }
    --- End diff --
    
    Thanks for your comment but I'am very interested in what you believe would 
be appropriate in this case and how you would solve it, because I think this is 
a *major issue* in the php thrift implementation.
    
    Here is mho:
    I understand why you complain about the `rand()`. 
    But a random number is much more useful than an sequential number that 
start with 0 and only increment itself. Before `seqid_` wasn't respected at all 
and it's used to identify whether the response belongs to my request or not, 
and not to determine the order of requests and responses. And lastly, the php 
client initiates the `seqid_` with 0 and so it could happen that two clients 
communicate with the server at the same time and client A receives the response 
of client B and doesn't track that issue because accidentally the `seqid_` is 
that one that client A expect.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to