Skip to content

Conversation

@dweiss
Copy link
Contributor

@dweiss dweiss commented Nov 19, 2025

TestIndexWriterWithThreads.testCloseWithThreads occasionally throws "Too many open files" from HandleLimitFS. This test is designed to run multiple threads in parallel, each thread adding documents and performing merges, while the main thread closes the index writer forcefully.

I rewrote the test slightly but didn't want to add too much thread coordination. I also bumped the HandleLimitFS to 4x the default limit. The test passes for me with -Ptests.iters=100 with no problems after that.

@dweiss dweiss self-assigned this Nov 19, 2025
@dweiss dweiss added this to the 11.0.0 milestone Nov 19, 2025
@dweiss dweiss added the skip-changelog Apply to PRs that don't need a changelog entry, stopping the automated changelog check. label Nov 19, 2025
@uschindler
Copy link
Contributor

Instead of raising the file limit, can we not reduce the number of threads?

Uwe

@dweiss
Copy link
Contributor Author

dweiss commented Nov 19, 2025

This won't work. The problem isn't the number of threads but that they add documents, uncoordinated. Even a single thread could - in theory - add so many documents and create so many intermediate segments that it'll overflow the limit. The test itself is designed to work this way - to allow indexing threads run uncontrollably until the index writer is closed... I don't think there is any reasonable way to throttle the speed with which those background threads index new documents without negating the very reason this test exists.

@uschindler
Copy link
Contributor

Ok,
I was just afraid that it fails on a real filesystem. Can we maybe change this test so it never uses real filesystem?
So hardcode to Bytebuffersdirectory.

@dweiss
Copy link
Contributor Author

dweiss commented Nov 20, 2025

I did think about this too but again - wasn't this meant to be checking all the layers, including directory implementations? This seems to be designed to check "what happens if I close the index writer underneath running indexing threads".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:core/index module:test-framework skip-changelog Apply to PRs that don't need a changelog entry, stopping the automated changelog check.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants