I'm attempting to write a unit test that emulates when a scroll query times out. I've set the value using seconds and milliseconds, and it is either being ignored, or there is some minimum threshold in the range of 10s of seconds. I'm not sure if I'm setting values improperly or there is a floor to the value.
Hi @arcsine,
how do you specify the timeout? Do you use the scroll
parameter? This value is not for timing out the network request but for keeping the scroll context alive (the cluster needs to store information about the current scroll).
Daniel
I'm using the Java API, and basically calling:
SearchResponse scroll = request
.setScroll(TimeValue.timeValueSeconds(1))
.setQueryCache(false)
.get()
Where request
is is a SearchRequestBuilder
.
The scroll window seems to stay open for much longer than 1s
and much closer to 15s
when I use it.
Hi @arcsine,
ok, so you set the scroll timeout. Unfortunately, this does not help with your problem. The scroll timeout does not apply to all requests you issue in the context of a scroll but each time you issue a scroll request (i.e. fetch a new page) so a scroll can stay open for longer than this timeout.
If you use the transport client, can you set transport.tcp.connect_timeout
to a small value (e.g. 50ms) when you create the client?
Daniel
That's a good idea. I will check that out and see if that helps.