-
Notifications
You must be signed in to change notification settings - Fork 188
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
Unexpected behaviour in ElasticsearchTestCase when querying too soon after initialization. #34
Comments
Just tried it with latest ONGRTestingBundle and ESB, everything works without exceptions. Maybe your client or java needs an update or try to reinstall. |
PHPUnit data coverage logging must be off. Since this seems to be a timing-related bug, milliseconds make a difference. |
This seems to be a problem with ES itself: vagrant@testvm:/var/www$ echo "";i=0; while [[ "$i" != "10" ]]; do curl -s -XDELETE 'localhost:9200/test'; curl -s -XPUT 'localhost:9200/test'; curl -XGET 'localhost:9200/test/_search/'; echo " "; i=`expr $i + 1`; done
{"acknowledged":true}{"acknowledged":true}{"took":1,"timed_out":false,"_shards":{"total":5,"successful":1,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
{"acknowledged":true}{"acknowledged":true}{"took":0,"timed_out":false,"_shards":{"total":5,"successful":3,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
{"acknowledged":true}{"acknowledged":true}{"took":0,"timed_out":false,"_shards":{"total":5,"successful":3,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
{"acknowledged":true}{"acknowledged":true}{"took":1,"timed_out":false,"_shards":{"total":5,"successful":1,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
{"acknowledged":true}{"acknowledged":true}{"took":0,"timed_out":false,"_shards":{"total":5,"successful":3,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
{"acknowledged":true}{"acknowledged":true}{"took":0,"timed_out":false,"_shards":{"total":5,"successful":3,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
{"acknowledged":true}{"acknowledged":true}{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]","status":503}
{"acknowledged":true}{"acknowledged":true}{"took":1,"timed_out":false,"_shards":{"total":5,"successful":2,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
{"acknowledged":true}{"acknowledged":true}{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]","status":503}
{"acknowledged":true}{"acknowledged":true}{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]","status":503}
vagrant@testvm:/var/www$ echo "";i=0; while [[ "$i" != "10" ]]; do curl -s -XDELETE 'localhost:9200/test'; curl -s -XPUT 'localhost:9200/test'; curl -XGET 'localhost:9200/test/_search/'; echo " "; i=`expr $i + 1`; done
{"acknowledged":true}{"acknowledged":true}{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]","status":503}
{"acknowledged":true}{"acknowledged":true}{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]","status":503}
{"acknowledged":true}{"acknowledged":true}{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]","status":503}
{"acknowledged":true}{"acknowledged":true}{"took":0,"timed_out":false,"_shards":{"total":5,"successful":1,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
{"acknowledged":true}{"acknowledged":true}{"took":0,"timed_out":false,"_shards":{"total":5,"successful":3,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
{"acknowledged":true}{"acknowledged":true}{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]","status":503}
{"acknowledged":true}{"acknowledged":true}{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]","status":503}
{"acknowledged":true}{"acknowledged":true}{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]","status":503}
{"acknowledged":true}{"acknowledged":true}{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]","status":503}
{"acknowledged":true}{"acknowledged":true}{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]","status":503} may I propose a delay of a few milliseconds after https://github.com/ongr-io/ElasticsearchBundle/blob/master/Test/ElasticsearchTestCase.php#L161 as a solution? |
I noticed few tests sometimes fails in travis with service unavailable or all shard failed response, but we can live with that currently. Delay is rarely a good solution :) |
alternative would be catching this particular exception and retrying, these guys (https://www.devmynd.com/blog/2014-2-dealing-with-failing-elasticserach-tests) seem to have solved this exact problem in the same fashion. |
I like it. I'll investigate how can we achieve this. |
Consider the following code:
The text was updated successfully, but these errors were encountered: