p.s. If I set thrift_framed_transport_size_in_mb to 0 and just use TSocket instead of TFramedTransport everything works as expected...

On 1 August 2010 12:16, Dan Washusen <dan@reactive.org> wrote:
Slightly off topic but still related (java instead of erlang).  I just tried using the latest trunk build available on Hudson (2010-07-31_12-31-29) and I'm getting lock ups.

The same code (without the framed transport) was working with a build form 2010-07-07_13-32-16

I'm connecting using the following:
TSocket socket = new TSocket(node, port);
transport = new TFramedTransport(socket);
protocol = new TBinaryProtocol(transport);
client = new Cassandra.Client(protocol);

transport.open();

// set the keyspace on the client and do get slice stuff
 

The locked up thread looks like:
"main" prio=5 tid=101801000 nid=0x100501000 runnable [1004fe000]
   java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
- locked <1093daa10> (a java.io.BufferedInputStream)
at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:127)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
at org.apache.thrift.transport.TFramedTransport.readFrame(TFramedTransport.java:129)
at org.apache.thrift.transport.TFramedTransport.read(TFramedTransport.java:101)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:369)
at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:295)
at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:202)
at org.apache.cassandra.thrift.Cassandra$Client.recv_get_slice(Cassandra.java:542)
at org.apache.cassandra.thrift.Cassandra$Client.get_slice(Cassandra.java:524)
 

On 28 July 2010 17:43, J T <jt4websites@googlemail.com> wrote:
Hi,

That fixed the problem!

I added the Framed option and like magic things have started working again.

Example:

thrift_client:start_link("localhost", 9160, cassandra_thrift, [ { framed, true } ] )

JT.



On Tue, Jul 27, 2010 at 10:04 PM, Jonathan Ellis <jbellis@gmail.com> wrote:
trunk is using framed thrift connections by default now (was unframed)

On Tue, Jul 27, 2010 at 11:33 AM, J T <jt4websites@googlemail.com> wrote:
> Hi,
> I just tried upgrading a perfectly working Cassandra 0.6.3 to Cassandra 0.7
> and am finding that even after re-generating the erlang thrift bindings that
> I am unable to perform any operation.
> I can get a connection but if I try to login or set the keyspace I get a
> report from the erlang bindings to say that the connection is closed.
> I then tried upgrading to a later version of thrift but still get the same
> error.
> e.g.
> (zotonic3989@127.0.0.1)1> thrift_client:start_link("localhost", 9160,
> cassandra_thrift).
> {ok,<0.327.0>}
> (zotonic3989@127.0.0.1)2> {ok,C}=thrift_client:start_link("localhost", 9160,
> cassandra_thrift).
> {ok,<0.358.0>}
> (zotonic3989@127.0.0.1)3> thrift_client:call( C, set_keyspace, [ <<"Test">>
>  ]).
> =ERROR REPORT==== 27-Jul-2010::03:48:08 ===
> ** Generic server <0.358.0> terminating
> ** Last message in was {call,set_keyspace,[<<"Test">>]}
> ** When Server state == {state,cassandra_thrift,
>                          {protocol,thrift_binary_protocol,
>                           {binary_protocol,
>                            {transport,thrift_buffered_transport,<0.359.0>},
>                            true,true}},
>                          0}
> ** Reason for termination ==
> ** {{case_clause,{error,closed}},
>     [{thrift_client,read_result,3},
>      {thrift_client,catch_function_exceptions,2},
>      {thrift_client,handle_call,3},
>      {gen_server,handle_msg,5},
>      {proc_lib,init_p_do_apply,3}]}
> ** exception exit: {case_clause,{error,closed}}
>      in function  thrift_client:read_result/3
>      in call from thrift_client:catch_function_exceptions/2
>      in call from thrift_client:handle_call/3
>      in call from gen_server:handle_msg/5
>      in call from proc_lib:init_p_do_apply/3
> The cassandra log seems to indicate that a connection has been made
> (although thats only apparent by a TRACE log message saying that a logout
> has been done).
> The cassandra-cli program is able to connect and function normally so I can
> only assume that there is a problem with the erlang bindings.
> Has anyone else had any success using 0.7 from Erlang ?
> JT.



--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com