OpenSearch/core
Simon Willnauer 29336b231b Add ref-counting to SearchContext to prevent accessing already closed readers (#20095)
When a SearchContext is closed it's reader / searcher reference is closed too.
If this happens while a search is accessing it's reader reference it can lead
to an unexpected `AlreadyClosedException` or worst case, an already closed MMapDirectory
is access causing a `SIGSEV` like in #20008 (even though the window for this is very small).

SearchContext can be closed concurrently if:
 * an index is deleted / removed from the node
 * a search context is idle for too long and is cleaned by the reaper
 * an explicit freeContext message is received

This change adds reference counting to the SearchContext base class and it's used
inside SearchService each time the context is accessed.

Closes #20008
2016-08-22 15:41:05 +02:00
..
src Add ref-counting to SearchContext to prevent accessing already closed readers (#20095) 2016-08-22 15:41:05 +02:00
build.gradle Update to Jackson 2.8.1 2016-08-05 12:26:06 +02:00