These are chat archives for aparo/pyes

26th
Feb 2015
Julian Hille
@julianhille
Feb 26 2015 07:53
hi, i saw some issues with retries and load balancing / round robin connection to servers.
How is the ES(..) class supposed to be used? Should i generate it once, (currently we have a singleton for it) or should we instantiate it every time?
because a single prevents load balancing completely
Alberto Paro
@aparo
Feb 26 2015 09:38
The ES class must be singleton to prevent connections leak
the balancing is managed by a random choose of servr target from the connection object
but you should manually refresh the state active of servers
Julian Hille
@julianhille
Feb 26 2015 09:54
the server is NOT randomly choosen
Alberto Paro
@aparo
Feb 26 2015 09:54
let me check
Julian Hille
@julianhille
Feb 26 2015 09:56
i can show you the line
there you grab the default from the object and some lines later if not server
then and only then is a new server choosen
ive also some code to have a test for it
the retries also have an issue, these both issues cause hotspotting of servers in our environment
back in some minutes
Julian Hille
@julianhille
Feb 26 2015 10:58
max_retries does not work as expected. The urlopen function from urllib has another "retry" parameter.
Tehse leads in connection timeouts too the same host used several times directly inside of urllib BEFORE the max retrying starts to be used inside of pyes.
Vitaly Babiy
@vbabiy
Feb 26 2015 18:15
Is there a way with pyes queryset to run an or query?
@aparo when I try to use complex_filter with a Q object I get _filter_or_exclude() argument after ** must be a mapping, not Q
Do I need to wrap the Q object?
The docs suggest I should be able to use a Q object
Alberto Paro
@aparo
Feb 26 2015 18:42
you can pass an OrFilyer
Vitaly Babiy
@vbabiy
Feb 26 2015 19:11
@aparo okay so don't use Q objects?
Should the OrFilter just be a list of TermFilters?
Alberto Paro
@aparo
Feb 26 2015 19:53
OrFilter takes a list of Filter.
you can put every kind of filters *Filter classes