-
Notifications
You must be signed in to change notification settings - Fork 974
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
Sniffing function not working properly #629
Comments
What version of Elasticsearch-PHP are you using? It does look like the format has changed slightly. Would you mind posting the output of your Node Info API (feel free to sanitize addresses/sensitive details)? I'd like to see if the output is different from 5.x, and how far changes need to be backported. |
Here's the sample of the sanitized output { I'm using the 5.3 version of elasticsearch-php |
I downgraded elasticsearch-php to 2.3.0 and noticed that the code is the same. I still can't sniff. |
This should be fixed. I'll tag a release in a bit... need to look after something else first. |
Please add these changes, they are imported from : Fix parsing of NodesInfo for Sniffing Closes elastic#629 and elastic#648 elastic@c0ed43c
This change is imported from : Fix parsing of NodesInfo for Sniffing Closes elastic#629 and elastic#648 elastic@c0ed43c
These changes are imported from : Fix parsing of NodesInfo for Sniffing Closes elastic#629 and elastic#648 for sniffing to work properly. elastic@c0ed43c
These changes are imported from : Fix parsing of NodesInfo for Sniffing Closes elastic#629 and elastic#648 for sniffing to work properly. elastic@c0ed43c
These changes are imported from : Fix parsing of NodesInfo for Sniffing Closes elastic#629 and elastic#648 for sniffing to work properly. elastic@c0ed43c
Summary of problem
The sniff function isn't picking the other nodes in the cluster when the connectionpool is set to \Elasticsearch\ConnectionPool\SniffingConnectionPool
The server is returning the host as 172.25.120.23:9200 format whenever a sniff function is done on Elasticsearch\Connections\Connection::sniff()
When Elasticsearch\ConnectionPool\SniffingConnectionPool::parseClusterState() is executed, the host and port is not properly captured due to wrong $pattern.
Code snippet of problem
The wrong pattern on line 131 of Elasticsearch\ConnectionPool\SniffingConnectionPool
Results in preg_match not matching the hosts 172.25.120.23:9200 on line 137 of Elasticsearch\ConnectionPool\SniffingConnectionPool
Regex Example: http://regexr.com/3gjoo
Proposed Change
I propose a change of regex on line 131 of Elasticsearch\ConnectionPool\SniffingConnectionPool
Regex Example: http://regexr.com/3gjor
Environment
ElasticSearch: 2.0.2
PHP: 7.1
The text was updated successfully, but these errors were encountered: