iconara / cql-rb

Cassandra CQL 3 binary protocol driver for Ruby
106 stars 31 forks source link

Wrong type given to Connection#close in some circumstances #99

Closed iconara closed 10 years ago

iconara commented 10 years ago

I've seen this happen a few times now when an application crashes during startup. The crash isn't triggered by this error, and the error can't be seen unless you run in JRuby with -Xlog.backtraces=true -Xlog.exceptions=true.

Exception raised: NoMethodError : undefined method `message' for #<Ione::CompletableFuture:0x3c78fb69>
  /Users/theo/.rvm/gems/jruby-1.7.12@some-gemset/gems/cql-rb-2.0.0.pre1/lib/cql/client/connector.rb:44 in register_logging
  org/jruby/RubyProc.java:271 in call
  /Users/theo/.rvm/gems/jruby-1.7.12@some-gemset/gems/ione-1.1.0.pre0/lib/ione/future.rb:368 in resolve
  org/jruby/RubyArray.java:1613 in each
  /Users/theo/.rvm/gems/jruby-1.7.12@some-gemset/gems/ione-1.1.0.pre0/lib/ione/future.rb:367 in resolve
  /Users/theo/.rvm/gems/jruby-1.7.12@some-gemset/gems/ione-1.1.0.pre0/lib/ione/future.rb:29 in fulfill
  /Users/theo/.rvm/gems/jruby-1.7.12@some-gemset/gems/cql-rb-2.0.0.pre1/lib/cql/protocol/cql_protocol_handler.rb:268 in socket_closed
  org/jruby/RubyProc.java:271 in call
  /Users/theo/.rvm/gems/jruby-1.7.12@some-gemset/gems/ione-1.1.0.pre0/lib/ione/io/base_connection.rb:102 in on_closed
  org/jruby/RubyProc.java:271 in call
  /Users/theo/.rvm/gems/jruby-1.7.12@some-gemset/gems/ione-1.1.0.pre0/lib/ione/future.rb:365 in resolve
  org/jruby/RubyArray.java:1613 in each
  /Users/theo/.rvm/gems/jruby-1.7.12@some-gemset/gems/ione-1.1.0.pre0/lib/ione/future.rb:364 in resolve
  /Users/theo/.rvm/gems/jruby-1.7.12@some-gemset/gems/ione-1.1.0.pre0/lib/ione/future.rb:29 in fulfill
  /Users/theo/.rvm/gems/jruby-1.7.12@some-gemset/gems/ione-1.1.0.pre0/lib/ione/io/base_connection.rb:32 in close
  /Users/theo/.rvm/gems/jruby-1.7.12@some-gemset/gems/ione-1.1.0.pre0/lib/ione/io/io_reactor.rb:286 in close_sockets
  org/jruby/RubyArray.java:1613 in each
  /Users/theo/.rvm/gems/jruby-1.7.12@some-gemset/gems/ione-1.1.0.pre0/lib/ione/io/io_reactor.rb:284 in close_sockets
  /Users/theo/.rvm/gems/jruby-1.7.12@some-gemset/gems/ione-1.1.0.pre0/lib/ione/io/io_reactor.rb:130 in start