You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Lucas Di Pentima <lu...@di-pentima.com.ar> on 2010/04/27 22:11:29 UTC

ThriftTransportException using Ruby Gem 0.8.2 against Cassandra 0.6.1

Hello,

I'm importing some data on Cassandra, running only on my laptop, with all config values by default. After some time running the import script I've written (which includes some reads besides the import writes), I get the following error message and stack trace:

/opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/transport/socket.rb:108:in `read': Socket: Timed out reading 4096 bytes from 127.0.0.1:9160 (Thrift::TransportException)
        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/transport/buffered_transport.rb:50:in `read'
        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/transport/base_transport.rb:52:in `read_all'
        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/protocol/binary_protocol.rb:186:in `read_i32'
        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/protocol/binary_protocol.rb:111:in `read_message_begin'
        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/client.rb:45:in `receive_message'
        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/../vendor/gen-rb/cassandra.rb:96:in `recv_multiget_slice'
        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/../vendor/gen-rb/cassandra.rb:88:in `multiget_slice'
        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:60:in `send'
        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:60:in `send_rpc'
        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:156:in `send_rpc'
        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:56:in `proxy'
        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:146:in `proxy'
        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:49:in `handled_proxy'
        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:142:in `handled_proxy'
        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:23:in `multiget_slice'
        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/cassandra/protocol.rb:69:in `_multiget'
        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/cassandra/cassandra.rb:204:in `multi_get'
        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/cassandra/cassandra.rb:195:in `get'

While this happened, the cassandra server didn't complained about anything, and tpstats kept with this values:

Pool Name                    Active   Pending      Completed
FILEUTILS-DELETE-POOL             0         0              2
STREAM-STAGE                      0         0              0
RESPONSE-STAGE                    0         0              1
ROW-READ-STAGE                    1         1         824743
LB-OPERATIONS                     0         0              0
MESSAGE-DESERIALIZER-POOL         0         0              0
GMFD                              0         0              0
LB-TARGET                         0         0              0
CONSISTENCY-MANAGER               0         0              0
ROW-MUTATION-STAGE                0         0        1747456
MESSAGE-STREAMING-POOL            0         0              0
LOAD-BALANCER-STAGE               0         0              0
FLUSH-SORTER-POOL                 0         0              0
MEMTABLE-POST-FLUSHER             0         0             12
FLUSH-WRITER-POOL                 0         0             12
AE-SERVICE-STAGE                  0         0              1

I was importing data from only one thread, using the same connection to Cassandra

Can you give me some help to solve this? Should I catch the exception and retry, or maybe there's some error that causing this behaviour?

Thanks in advance
--
Lucas Di Pentima - Santa Fe, Argentina
Jabber: lucas@di-pentima.com.ar
MSN: ldipenti75@hotmail.com





Re: ThriftTransportException using Ruby Gem 0.8.2 against Cassandra 0.6.1

Posted by Lucas Di Pentima <lu...@di-pentima.com.ar>.
El 27/04/2010, a las 19:00, Ryan King escribió:

> On Tue, Apr 27, 2010 at 2:29 PM, Lucas Di Pentima
> <lu...@di-pentima.com.ar> wrote:
>> 
>> El 27/04/2010, a las 18:11, Ryan King escribió:
>> 
>>> On Tue, Apr 27, 2010 at 1:38 PM, Lucas Di Pentima
>>> <lu...@di-pentima.com.ar> wrote:
>>> 
>>>> Nope, I'm doing some tests locally on my notebook (Macbook OSX 10.6.3 w/4GB RAM). My script insert several hundred thousand columns with stable speed, and then it exits throwing that exception.
>>> 
>>> Its possible you're running into a different problem then. Have you
>>> tried raising the timeout?
>> 
>> 
>> Sorry, but I don't know how to do that. Can you point me where to look? I looked in cassandra gem and didn't found any timeout reference.
> 
> Its actually in thrift client, not the cassandra gem, I believe its
> something like:
> 
> Cassandra.new('Twitter', "127.0.0.1:9160", :timeout => 0.1) #timeout
> is in seconds.


Oops, missed socket.rb, thanks Ryan I'll give it a try. I noticed that is doesn't have any default timeout value, so I'll start with 1.0 sec.

Best regards
--
Lucas Di Pentima - Santa Fe, Argentina
Jabber: lucas@di-pentima.com.ar
MSN: ldipenti75@hotmail.com





Re: ThriftTransportException using Ruby Gem 0.8.2 against Cassandra 0.6.1

Posted by Ryan King <ry...@twitter.com>.
On Tue, Apr 27, 2010 at 2:29 PM, Lucas Di Pentima
<lu...@di-pentima.com.ar> wrote:
>
> El 27/04/2010, a las 18:11, Ryan King escribió:
>
>> On Tue, Apr 27, 2010 at 1:38 PM, Lucas Di Pentima
>> <lu...@di-pentima.com.ar> wrote:
>>
>>> Nope, I'm doing some tests locally on my notebook (Macbook OSX 10.6.3 w/4GB RAM). My script insert several hundred thousand columns with stable speed, and then it exits throwing that exception.
>>
>> Its possible you're running into a different problem then. Have you
>> tried raising the timeout?
>
>
> Sorry, but I don't know how to do that. Can you point me where to look? I looked in cassandra gem and didn't found any timeout reference.

Its actually in thrift client, not the cassandra gem, I believe its
something like:

Cassandra.new('Twitter', "127.0.0.1:9160", :timeout => 0.1) #timeout
is in seconds.

-ryan

Re: ThriftTransportException using Ruby Gem 0.8.2 against Cassandra 0.6.1

Posted by Lucas Di Pentima <lu...@di-pentima.com.ar>.
El 27/04/2010, a las 18:11, Ryan King escribió:

> On Tue, Apr 27, 2010 at 1:38 PM, Lucas Di Pentima
> <lu...@di-pentima.com.ar> wrote:
> 
>> Nope, I'm doing some tests locally on my notebook (Macbook OSX 10.6.3 w/4GB RAM). My script insert several hundred thousand columns with stable speed, and then it exits throwing that exception.
> 
> Its possible you're running into a different problem then. Have you
> tried raising the timeout?


Sorry, but I don't know how to do that. Can you point me where to look? I looked in cassandra gem and didn't found any timeout reference.

Thanks in advance
--
Lucas Di Pentima - Santa Fe, Argentina
Jabber: lucas@di-pentima.com.ar
MSN: ldipenti75@hotmail.com





Re: ThriftTransportException using Ruby Gem 0.8.2 against Cassandra 0.6.1

Posted by Ryan King <ry...@twitter.com>.
On Tue, Apr 27, 2010 at 1:38 PM, Lucas Di Pentima
<lu...@di-pentima.com.ar> wrote:

> Nope, I'm doing some tests locally on my notebook (Macbook OSX 10.6.3 w/4GB RAM). My script insert several hundred thousand columns with stable speed, and then it exits throwing that exception.

Its possible you're running into a different problem then. Have you
tried raising the timeout?

-ryan

Re: ThriftTransportException using Ruby Gem 0.8.2 against Cassandra 0.6.1

Posted by Lucas Di Pentima <lu...@di-pentima.com.ar>.
El 27/04/2010, a las 17:34, Ryan King escribió:

> On Tue, Apr 27, 2010 at 1:31 PM, Lucas Di Pentima
> <lu...@di-pentima.com.ar> wrote:
>> Thanks Ryan for the fast response! Can you explain to me why binding against 127.0.0.1 causes the problem? Maybe it's useful to point this out in the documentation to avoid users deploy this kind of setups.
> 
> Are you trying to talk to the cassandra host from somewhere other than
> the host its running on?


Nope, I'm doing some tests locally on my notebook (Macbook OSX 10.6.3 w/4GB RAM). My script insert several hundred thousand columns with stable speed, and then it exits throwing that exception.

--
Lucas Di Pentima - Santa Fe, Argentina
Jabber: lucas@di-pentima.com.ar
MSN: ldipenti75@hotmail.com





Re: ThriftTransportException using Ruby Gem 0.8.2 against Cassandra 0.6.1

Posted by Ryan King <ry...@twitter.com>.
On Tue, Apr 27, 2010 at 1:31 PM, Lucas Di Pentima
<lu...@di-pentima.com.ar> wrote:
> Thanks Ryan for the fast response! Can you explain to me why binding against 127.0.0.1 causes the problem? Maybe it's useful to point this out in the documentation to avoid users deploy this kind of setups.

Are you trying to talk to the cassandra host from somewhere other than
the host its running on?

-ryan

Re: ThriftTransportException using Ruby Gem 0.8.2 against Cassandra 0.6.1

Posted by Lucas Di Pentima <lu...@di-pentima.com.ar>.
Thanks Ryan for the fast response! Can you explain to me why binding against 127.0.0.1 causes the problem? Maybe it's useful to point this out in the documentation to avoid users deploy this kind of setups.

Thanks again!

El 27/04/2010, a las 17:28, Ryan King escribió:

> It looks like you need to update your storage-conf to bind to an ip
> other than loopback.
> 
> -ryan
> 
> On Tue, Apr 27, 2010 at 1:11 PM, Lucas Di Pentima
> <lu...@di-pentima.com.ar> wrote:
>> Hello,
>> 
>> I'm importing some data on Cassandra, running only on my laptop, with all config values by default. After some time running the import script I've written (which includes some reads besides the import writes), I get the following error message and stack trace:
>> 
>> /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/transport/socket.rb:108:in `read': Socket: Timed out reading 4096 bytes from 127.0.0.1:9160 (Thrift::TransportException)
>>        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/transport/buffered_transport.rb:50:in `read'
>>        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/transport/base_transport.rb:52:in `read_all'
>>        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/protocol/binary_protocol.rb:186:in `read_i32'
>>        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/protocol/binary_protocol.rb:111:in `read_message_begin'
>>        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/client.rb:45:in `receive_message'
>>        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/../vendor/gen-rb/cassandra.rb:96:in `recv_multiget_slice'
>>        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/../vendor/gen-rb/cassandra.rb:88:in `multiget_slice'
>>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:60:in `send'
>>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:60:in `send_rpc'
>>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:156:in `send_rpc'
>>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:56:in `proxy'
>>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:146:in `proxy'
>>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:49:in `handled_proxy'
>>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:142:in `handled_proxy'
>>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:23:in `multiget_slice'
>>        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/cassandra/protocol.rb:69:in `_multiget'
>>        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/cassandra/cassandra.rb:204:in `multi_get'
>>        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/cassandra/cassandra.rb:195:in `get'
>> 
>> While this happened, the cassandra server didn't complained about anything, and tpstats kept with this values:
>> 
>> Pool Name                    Active   Pending      Completed
>> FILEUTILS-DELETE-POOL             0         0              2
>> STREAM-STAGE                      0         0              0
>> RESPONSE-STAGE                    0         0              1
>> ROW-READ-STAGE                    1         1         824743
>> LB-OPERATIONS                     0         0              0
>> MESSAGE-DESERIALIZER-POOL         0         0              0
>> GMFD                              0         0              0
>> LB-TARGET                         0         0              0
>> CONSISTENCY-MANAGER               0         0              0
>> ROW-MUTATION-STAGE                0         0        1747456
>> MESSAGE-STREAMING-POOL            0         0              0
>> LOAD-BALANCER-STAGE               0         0              0
>> FLUSH-SORTER-POOL                 0         0              0
>> MEMTABLE-POST-FLUSHER             0         0             12
>> FLUSH-WRITER-POOL                 0         0             12
>> AE-SERVICE-STAGE                  0         0              1
>> 
>> I was importing data from only one thread, using the same connection to Cassandra
>> 
>> Can you give me some help to solve this? Should I catch the exception and retry, or maybe there's some error that causing this behaviour?
>> 
>> Thanks in advance
>> --
>> Lucas Di Pentima - Santa Fe, Argentina
>> Jabber: lucas@di-pentima.com.ar
>> MSN: ldipenti75@hotmail.com
>> 
>> 
>> 
>> 
>> 

--
Lucas Di Pentima - Santa Fe, Argentina
Jabber: lucas@di-pentima.com.ar
MSN: ldipenti75@hotmail.com





Re: ThriftTransportException using Ruby Gem 0.8.2 against Cassandra 0.6.1

Posted by Ryan King <ry...@twitter.com>.
It looks like you need to update your storage-conf to bind to an ip
other than loopback.

-ryan

On Tue, Apr 27, 2010 at 1:11 PM, Lucas Di Pentima
<lu...@di-pentima.com.ar> wrote:
> Hello,
>
> I'm importing some data on Cassandra, running only on my laptop, with all config values by default. After some time running the import script I've written (which includes some reads besides the import writes), I get the following error message and stack trace:
>
> /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/transport/socket.rb:108:in `read': Socket: Timed out reading 4096 bytes from 127.0.0.1:9160 (Thrift::TransportException)
>        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/transport/buffered_transport.rb:50:in `read'
>        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/transport/base_transport.rb:52:in `read_all'
>        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/protocol/binary_protocol.rb:186:in `read_i32'
>        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/protocol/binary_protocol.rb:111:in `read_message_begin'
>        from /opt/local/lib/ruby/gems/1.8/gems/thrift-0.2.0/lib/thrift/client.rb:45:in `receive_message'
>        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/../vendor/gen-rb/cassandra.rb:96:in `recv_multiget_slice'
>        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/../vendor/gen-rb/cassandra.rb:88:in `multiget_slice'
>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:60:in `send'
>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:60:in `send_rpc'
>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:156:in `send_rpc'
>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:56:in `proxy'
>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:146:in `proxy'
>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:49:in `handled_proxy'
>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:142:in `handled_proxy'
>        from /opt/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:23:in `multiget_slice'
>        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/cassandra/protocol.rb:69:in `_multiget'
>        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/cassandra/cassandra.rb:204:in `multi_get'
>        from /opt/local/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/cassandra/cassandra.rb:195:in `get'
>
> While this happened, the cassandra server didn't complained about anything, and tpstats kept with this values:
>
> Pool Name                    Active   Pending      Completed
> FILEUTILS-DELETE-POOL             0         0              2
> STREAM-STAGE                      0         0              0
> RESPONSE-STAGE                    0         0              1
> ROW-READ-STAGE                    1         1         824743
> LB-OPERATIONS                     0         0              0
> MESSAGE-DESERIALIZER-POOL         0         0              0
> GMFD                              0         0              0
> LB-TARGET                         0         0              0
> CONSISTENCY-MANAGER               0         0              0
> ROW-MUTATION-STAGE                0         0        1747456
> MESSAGE-STREAMING-POOL            0         0              0
> LOAD-BALANCER-STAGE               0         0              0
> FLUSH-SORTER-POOL                 0         0              0
> MEMTABLE-POST-FLUSHER             0         0             12
> FLUSH-WRITER-POOL                 0         0             12
> AE-SERVICE-STAGE                  0         0              1
>
> I was importing data from only one thread, using the same connection to Cassandra
>
> Can you give me some help to solve this? Should I catch the exception and retry, or maybe there's some error that causing this behaviour?
>
> Thanks in advance
> --
> Lucas Di Pentima - Santa Fe, Argentina
> Jabber: lucas@di-pentima.com.ar
> MSN: ldipenti75@hotmail.com
>
>
>
>
>