Description
This has to do with query cancelation and I thought that the way Lucene 4 implemented query rewrites this would not be needed anymore. However I was wrong. During leading wildcard queries the all the terms of a field have to be traversed and if the field is very large this can cause a lot of processing to occur. During this term iteration if the query is canceled or it timeouts the thread has no way of exiting the iteration loop.
The ExitableReader provides a lightweight wrapper around a standard DirectoryReader and will throw an exception once the internal AtomicBoolean is set to false.