Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CLIENT] allow transports to close connections during __rebuild_conne…
…ctions adds a no-op __close_connections called during __rebuild_connections this commit also implements this method for manticore transport that marks all connections as dead and calls Manticore::Client#close for each connection Closes #241 See: cheald/manticore#39 Related: #245, logstash-plugins/logstash-output-elasticsearch#306
- Loading branch information
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7ba1fbd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
7ba1fbd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change introduce an error:
{:timestamp=>"2015-12-18T15:11:28.905000+0000", :message=>"undefined method
close' for #<Manticore::Client:0x16506b32>", :class=>"NoMethodError", :backtrace=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.15/lib/elasticsearch/transport/transport/http/manticore.rb:115:in
__close_connections'", "org/jruby/RubyArray.java:1613:ineach'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.15/lib/elasticsearch/transport/transport/http/manticore.rb:115:in
__close_connections'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.15/lib/elasticsearch/transport/transport/base.rb:99:in__rebuild_connections'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.15/lib/elasticsearch/transport/transport/base.rb:77:in
reload_connections!'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-2.2.0-java/lib/logstash/outputs/elasticsearch/http_client.rb:85:insniff!'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-2.2.0-java/lib/logstash/outputs/elasticsearch/http_client.rb:73:in
start_sniffing!'", "org/jruby/ext/thread/Mutex.java:149:insynchronize'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-2.2.0-java/lib/logstash/outputs/elasticsearch/http_client.rb:73:in
start_sniffing!'", "org/jruby/RubyKernel.java:1479:inloop'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-2.2.0-java/lib/logstash/outputs/elasticsearch/http_client.rb:72:in
start_sniffing!'"], :level=>:error}7ba1fbd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cnocito That would be weird, see the tests. Note that it relies on a fairly nws version of the manticore library, which one do you have?
7ba1fbd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a problem with the Gemfile, which should have bumped the minimum required version for the manticore gem :(
7ba1fbd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/opt/logstash/vendor/bundle/jruby/1.9/gems/manticore-0.4.4-java/ext/manticore
/opt/logstash/vendor/bundle/jruby/1.9/gems/manticore-0.4.4-java/ext/manticore/org/manticore
/opt/logstash/vendor/bundle/jruby/1.9/gems/manticore-0.4.4-java/spec/manticore
/opt/logstash/vendor/bundle/jruby/1.9/gems/manticore-0.4.4-java/lib/manticore
7ba1fbd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to correct my previous statement: this is not about the Gemfile or gemspec specifying the wrong version of manticore.
Since the transport is selectable (between manticore, faraday, curb), there is no runtime dependency on these transport gems. Which creates a problem in this scenario where we need to ensure at least manticore version X is used IF you select it as your transporter.
A workaround is to check the gem version when doing a require and abort, but that doesn't fix the dependency resolution at install time..
7ba1fbd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I agree with jsvd. Latest Manticore version is 0.5.2, the logstash installer comes with 0.4.4... I yum installed today, something needs to be updated for this fix.
7ba1fbd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cnocito We'll have a look at tightening up the versions here, thanks for the report!!
7ba1fbd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karmi , you are welcome!