Very large windows_size can cause node to run OOM (original) (raw)

Elasticsearch version: 2.1.x, 2.3.1 (not reproducible using 2.0.x)

Steps to reproduce:

  1. Create an empty index (eg. curl -XPUT http://localhost:9200/foo)
  2. Then run the query:
curl -XGET "http://localhost:9200/foo/_search" -d' 
{
  "rescore": {
    "window_size": 10000000,
    "query": {
      "match_all": {}
    }
  }
}'

On 2.0.x, the query will return immediately. On 2.1x and above (including 2.3.1), the query will go to town and use CPU and memory until it OOM.