-
Notifications
You must be signed in to change notification settings - Fork 85
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
Cannot get Connection from Pool #76
Comments
Steps to reproduce:
|
We have discussed this morning and like I've said it appear to be a thread safety issues in the elasticsearch-ruby client that is show under heavy load. We have two plan for this plugin: Long term Short term |
Since the ES Ruby client isn't thread safe, we are currently using Thread local to create a client per workers to make the connection pool thread safe. closes: logstash-plugins#76
@gingerwizard I have created #77, and it appears to fix the issue you were having. With your use case I can reproduce the error when I apply the PR the error is gone. I have created #78 as a long term goal. |
Since the ES Ruby client isn't thread safe, we are currently using Thread local to create a client per workers to make the connection pool thread safe. closes: logstash-plugins#76
Version: 5.5.1
Operating System: OSX
Steps to Reproduce:
This issue manifests itself when the plugin is under high load with more than 1 LS worker configured. Assuming each document results in an ES query (these typically execute in a few ms) the plugin with perodically log:
[2017-09-13T14:39:37,075][WARN ][logstash.filters.elasticsearch] Failed to query elasticsearch for previous event {:index=>"threats", :query=>{"query"=>{"percolate"=>{"field"=>"query", "document_type"=>"threat", "document"=>{"entity"=>["MacBook-Pro.local", "fe80::12c3:7bff:fede:dc18", "fe80::83f:d39:1b5d:a2d4"]}}}, "size"=>10}, :event=>2017-03-30T22:51:21.628Z MacBook-Pro.local %{message}, :error=>#<Elasticsearch::Transport::Transport::Error: Cannot get new connection from pool.>}
With a single worker this issue does not occur. I will assemble a reproducible config and test case.
The text was updated successfully, but these errors were encountered: