Reputation: 10469
I'm using ruby 2.1.2 to stress test a java service as follows:
(begin thread)
url = "http://service.ops.net/api"
transport = Thrift::HTTPClientTransport.new(url)
protocol = Thrift::CompactProtocol.new(transport)
client = MyService::Client.new(protocol)
transport.open()
client.<somefunctioncall>
(end thread)
...
(join thread)
(exit and begin next pass)
This is called with a mix of valid and semi-valid params. This works ok as long as I only call one endpoint. If I thread out the calls to hit > 1 endpoint at a time (IE call two different functions from different threads) I start seeing exceptions like so:
`read_message_begin': Expected protocol id -126 but got 60 (Thrift::ProtocolException)
I can't find a reasonable reference to know what this is telling me.
Upvotes: 1
Views: 1169
Reputation: 13411
The message is telling you that the data could not be deserialized, because they look corrupted. However, that does not mean that they really are corrupted.
A very likely reason for this situation is that client and server do not use the exact same transport & protocol stack.
A typical mistake to produce such a situation is to use TFramedTransport
on one end, while the other end does not. Thrift Transports may add (and expect) additional data to the data on the wire, and especially TFramedTransport
does this by adding a 4-byte header which contains the frame size.
It is worth mentioning that some server types implicitly expect the client to use TFramedTransport
. So if you checked both ends and compared the protocol and transport stack used, this may be another reason.
Upvotes: 1