[
https://issues.apache.org/jira/browse/THRIFT-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13539762#comment-13539762
]
Nathan Beyer commented on THRIFT-1803:
--------------------------------------
{quote}
Tony Spataro added a comment - 26/Dec/12 13:35
Thank you for pointer to the related issue; THRIFT-1766 seems like the core
issue here.
The Cassandra Ruby library isn't yet aware of String encodings.
In this particular case, I don't think it would make a difference because the
cassandra library does grok that UUID objects must be converted to a String,
and the encoding of the resulting String objects is correct (BINARY, aka
ASCII-8BIT) – so the Cassandra library is doing the right thing for an IDL
element whose type is "binary."{quote}
Based on that, Cassandra is doing the appropriate thing. THRIFT-1766 should fix
this issue then. If you or anyone can try running a patched version and testing
it to see if it fixes the issue, I'd appreciate the additional verification of
THRIFT-1766's patches.
> Ruby Thrift 0.9.0 tries to encode UUID to UTF8 and crashes
> ----------------------------------------------------------
>
> Key: THRIFT-1803
> URL: https://issues.apache.org/jira/browse/THRIFT-1803
> Project: Thrift
> Issue Type: Bug
> Components: Ruby - Library
> Affects Versions: 0.9
> Environment: $ uname -a
> Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.32-1 x86_64 GNU/Linux
> (Debian 7 testing)
> Cassandra 1.0.12
> rvm 1.17.2 (stable)
> ruby-1.9.2-p290
> $ bundle list
> Gems included by the bundle:
> * bundler (1.2.3)
> * cassandra (0.17.0)
> * json (1.7.5)
> * rake (10.0.3)
> * simple_uuid (0.2.0)
> * thrift (0.9.0)
> * thrift_client (0.8.3)
> Reporter: Aliaksei Kruk
>
> Cassandra supports UUID comparator type and thrift 0.8 works with UUID
> without problems.
> cassandra-cli:
> create column family test_uuid with comparator = 'TimeUUIDType';
> ruby:
> require 'cassandra'
> cassandra = Cassandra.new('test', '127.0.0.1:9160')
> cassandra.insert('test_uuid', '1', {SimpleUUID::UUID.new(Time.now.utc) =>
> 'ok' })
> execution:
> $ bundle exec ruby lib/test.rb
> /home/lioxa/.rvm/gems/ruby-1.9.2-p290@test/gems/thrift-0.9.0/lib/thrift/bytes.rb:81:in
> `encode': "\xA2" from ASCII-8BIT to UTF-8
> (Encoding::UndefinedConversionError)
> from
> /home/lioxa/.rvm/gems/ruby-1.9.2-p290@test/gems/thrift-0.9.0/lib/thrift/bytes.rb:81:in
> `convert_to_utf8_byte_buffer'
> from
> /home/lioxa/.rvm/gems/ruby-1.9.2-p290@test/gems/thrift-0.9.0/lib/thrift/client.rb:35:in
> `write_string'
> from
> /home/lioxa/.rvm/gems/ruby-1.9.2-p290@test/gems/thrift-0.9.0/lib/thrift/client.rb:35:in
> `write'
> from
> /home/lioxa/.rvm/gems/ruby-1.9.2-p290@test/gems/thrift-0.9.0/lib/thrift/client.rb:35:in
> `send_message'
> from
> /home/lioxa/.rvm/gems/ruby-1.9.2-p290@test/gems/cassandra-0.17.0/vendor/0.8/gen-rb/cassandra.rb:247:in
> `send_batch_mutate'
> from
> /home/lioxa/.rvm/gems/ruby-1.9.2-p290@test/gems/cassandra-0.17.0/vendor/0.8/gen-rb/cassandra.rb:242:in
> `batch_mutate'
> from
> /home/lioxa/.rvm/gems/ruby-1.9.2-p290@test/gems/thrift_client-0.8.3/lib/thrift_client/abstract_thrift_client.rb:159:in
> `block in handled_proxy'
> from
> /home/lioxa/.rvm/gems/ruby-1.9.2-p290@test/gems/thrift_client-0.8.3/lib/thrift_client/abstract_thrift_client.rb:140:in
> `ensure_socket_alignment'
> from
> /home/lioxa/.rvm/gems/ruby-1.9.2-p290@test/gems/thrift_client-0.8.3/lib/thrift_client/abstract_thrift_client.rb:159:in
> `handled_proxy'
> from
> /home/lioxa/.rvm/gems/ruby-1.9.2-p290@test/gems/thrift_client-0.8.3/lib/thrift_client/abstract_thrift_client.rb:53:in
> `batch_mutate'
> from
> /home/lioxa/.rvm/gems/ruby-1.9.2-p290@test/gems/cassandra-0.17.0/lib/cassandra/protocol.rb:7:in
> `_mutate'
> from
> /home/lioxa/.rvm/gems/ruby-1.9.2-p290@test/gems/cassandra-0.17.0/lib/cassandra/cassandra.rb:463:in
> `insert'
> from lib/test.rb:4:in `<main>'
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira