Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reconnect! method resets the @servers parameter #20

Closed
subelsky opened this issue Apr 7, 2010 · 3 comments
Closed

reconnect! method resets the @servers parameter #20

subelsky opened this issue Apr 7, 2010 · 3 comments

Comments

@subelsky
Copy link
Contributor

subelsky commented Apr 7, 2010

I believe this code in cassandra.rb does not respect the @servers parameter:

def new_client
thrift_client_class.new(CassandraThrift::Cassandra::Client, @servers, @thrift_client_options)
end

It seems to return a client which uses the default localhost value for @servers, which causes this to happen:

irb(main):005:0> cass = Cassandra.new(:OtherInbox,"10.208.130.191:9160")
=> #<Cassandra:77305550, @keyspace=:OtherInbox, @Schema={}, @servers=["10.208.130.191:9160"]>
irb(main):006:0> cass.instance_eval { @servers }
=> ["10.208.130.191:9160"]
irb(main):007:0> cass.get(:MerchantDomains,'example.com')
ThriftClient::NoServersAvailable: No live servers in ["127.0.0.1:9160"] since Wed Apr 07 14:11:45 +0000 2010.
from /usr/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:124:in next_server' from /usr/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:102:inconnect!'
from /usr/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:183:in connect!' from /usr/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:55:inproxy'
from /usr/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:146:in proxy' from /usr/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:49:inhandled_proxy'
from /usr/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:142:in handled_proxy' from /usr/local/lib/ruby/gems/1.8/gems/thrift_client-0.4.1/lib/thrift_client/abstract_thrift_client.rb:23:inget_string_list_property'
from /usr/local/lib/ruby/gems/1.8/gems/cassandra-0.8.1/lib/cassandra/cassandra.rb:286:in check_keyspace' from /usr/local/lib/ruby/gems/1.8/gems/cassandra-0.8.1/lib/cassandra/cassandra.rb:282:inreconnect!'
from /usr/local/lib/ruby/gems/1.8/gems/cassandra-0.8.1/lib/cassandra/cassandra.rb:275:in client' from /usr/local/lib/ruby/gems/1.8/gems/cassandra-0.8.1/lib/cassandra/cassandra.rb:270:inschema'
from /usr/local/lib/ruby/gems/1.8/gems/cassandra-0.8.1/lib/cassandra/columns.rb:31:in column_family_property' from /usr/local/lib/ruby/gems/1.8/gems/cassandra-0.8.1/lib/cassandra/columns.rb:20:incolumn_name_class_for_key'
from /usr/local/lib/ruby/gems/1.8/gems/cassandra-0.8.1/lib/cassandra/columns.rb:12:in column_name_class' from /usr/local/lib/ruby/gems/1.8/gems/cassandra-0.8.1/lib/cassandra/helpers.rb:20:inextract_and_validate_params'
from /usr/local/lib/ruby/gems/1.8/gems/cassandra-0.8.1/lib/cassandra/cassandra.rb:197:in multi_get' from /usr/local/lib/ruby/gems/1.8/gems/cassandra-0.8.1/lib/cassandra/cassandra.rb:190:inget'
from (irb
irb(main):009:0> cass.instance_eval { @servers }
=> ["127.0.0.1:9160"]

I am working on a patch but dont' fully understand how the thrift client works; thought I'd post here first in case this is already known to you.

@subelsky
Copy link
Contributor Author

subelsky commented Apr 7, 2010

seems like it must be a problem with the thrift client gem and my particular network setup -- I'm not able to reproduce it in a test. grr.

@subelsky
Copy link
Contributor Author

subelsky commented Apr 7, 2010

this should probably be merged into issue 10 http://github.com/fauna/cassandra/issues/issue/10/

@subelsky
Copy link
Contributor Author

subelsky commented Apr 7, 2010

Ah hah! Found the answer in issue 15; you need to set the ListenAddress properly in the Cassandra server config. Will be submitting a doc patch to help others. http://github.com/fauna/cassandra/issues/closed#issue/15

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant