It this issue urgent?
No, I don't think it's urgent. The reason I opened it is just that we hit a test failure in Elasticsearch which was due to core closed listeners not being called, and the root cause was this issue. But we don't use ParallelCompositeReader, it was introduced by LuceneTestCase.newSearcher.
You removed this test:
I think it's still here, I just refactored the test to make it easier to test all combinations of `closeSubReaders` and whether sub readers are leaf or composite readers. You can try to revert changes in src/test and TestParallelCompositeReader will still pass.
Another solution to fix this would be to also add all those deeper nested synthetic subreaders to the completeReaderSet (see last line of ctor). In that case they can stay with docClose() empty (to not affect refcount). I will try this out.
Oh I see, so the bug is that we are not adding all created synthetic readers to this set currently. This sounds like a good fix to me.
I liked the fact that you mentioned the second option would simplify the whole thing but I'm also afraid this would be a more significant change. So maybe we can first apply your first idea to fix the bug and later think about whether it would make sense to flatten the whole IndexReader structure to simplify this class.