calls hang on incompatible types
--------------------------------
Key: THRIFT-24
URL: https://issues.apache.org/jira/browse/THRIFT-24
Project: Thrift
Issue Type: Bug
Components: Compiler (Ruby)
Environment: osx 10.5.2, thrift svn trunk
Reporter: Ben Taitelbaum
When passing a string when an array is expected, the call hangs. I think the
best solution would be to add type checking to thrift calls so that an
appropriate exception (or a TTransportException with an appropriate message).
To reproduce:
1. I added the following call to tutorial.thrift (in service Calculator):
list<string> identity(1:list<string> obj)
2. I added an implementation to RubyService.rb
3. I changed the calls in RubyClient.rb to:
client.ping()
print "ping()\n"
puts client.identity(['hello', 'world']).inspect
puts client.identity('hello world').inspect
Server output (it hung, so I pressed Ctrl+c on the server):
Starting the server...
ping()
^C./thrift/transport/tsocket.rb:47:in `recv': Interrupt
from ./thrift/transport/tsocket.rb:47:in `read'
from ./thrift/transport/ttransport.rb:91:in `read'
from ./thrift/transport/ttransport.rb:44:in `readAll'
from ./thrift/protocol/tbinaryprotocol.rb:151:in `readI32'
from ./thrift/protocol/tbinaryprotocol.rb:178:in `readString'
from ./thrift/protocol/tprotocol.rb:161:in `read_type'
from ./thrift/thrift.rb:263:in `read_field'
from ./thrift/thrift.rb:251:in `read_field'
... 9 levels...
from ./thrift/thrift.rb:42:in `send'
from ./thrift/thrift.rb:42:in `process'
from ./thrift/server/tserver.rb:43:in `serve'
from ./RubyServer.rb:80
Client output (this time, I pressed ctrl+c on the client):
ping()
["hello", "world"]
^C./thrift/transport/tsocket.rb:47:in `recv': Interrupt
from ./thrift/transport/tsocket.rb:47:in `read'
from ./thrift/transport/ttransport.rb:91:in `read'
from ./thrift/transport/ttransport.rb:44:in `readAll'
from ./thrift/protocol/tbinaryprotocol.rb:151:in `readI32'
from ./thrift/protocol/tbinaryprotocol.rb:89:in `readMessageBegin'
from ./thrift/thrift.rb:160:in `receive_message'
from ../gen-rb/Calculator.rb:78:in `recv_identity'
from ../gen-rb/Calculator.rb:70:in `identity'
from ./RubyClient.rb:23
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.