Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1803

Ruby Thrift 0.9.0 tries to encode UUID to UTF8 and crashes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9
    • 0.9.2
    • Ruby - Library
    • None

    Description

      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>'

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lioxa Aliaksei Kruk
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: