Skip to content

Fix TestIndexWriterWithThreads#testIOExceptionDuringAbortWithThreadsOnlyOnce #14424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

guojialiang92
Copy link
Contributor

@guojialiang92 guojialiang92 commented Apr 1, 2025

Description

This PR aims to address issue 14423.

Tests

  1. In order to stabilize the reproduce problem, I added a test TestIndexWriterWithThreads#testIOExceptionWithMergeNotEndLongTime. I added the details of the test code to 14423. Because the test TestIndexWriterWithThreads#testIOExceptionWithMergeNotEndLongTime requires changing IndexWriter#maybeCloseOnTragicEvent access permissions, I did not include it in the PR.
  2. I fixed TestIndexWriterWithThreads#testIOExceptionDuringAbortWithThreadsOnlyOnce.

Checklist

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have given Lucene maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.

@guojialiang92 guojialiang92 changed the title fix TestIndexWriterWithThreads#testIOExceptionDuringAbortWithThreadsOnlyOnce Fix TestIndexWriterWithThreads#testIOExceptionDuringAbortWithThreadsOnlyOnce Apr 8, 2025
@aoli-al
Copy link
Contributor

aoli-al commented Apr 9, 2025

Nice! I tested the patch using Fray and confirmed that there is no longer a RuntimeException.

You can check how I use Fray to run the test here: https://github.com/aoli-al/lucene/tree/dev/fix-still-exist-open-files-after-close-directory with command ./gradlew :lucene:core:frayTest --tests "org.apache.lucene.index.TestIndexWriterWithThreads.testIOExceptionDuringAbortWithThreadsOnlyOnceWithFray" (it will test different interleavings for 1 minute)

@guojialiang92
Copy link
Contributor Author

Thank you @aoli-al, looking forward to the reviewer merging this fix.

@benwtrent benwtrent self-assigned this Apr 10, 2025
@benwtrent
Copy link
Member

I think this change is fine and prevents some flakiness :). I will merge and backport to 10x.

@benwtrent benwtrent merged commit 872eba6 into apache:main Apr 10, 2025
7 checks passed
benwtrent pushed a commit that referenced this pull request Apr 10, 2025
…nlyOnce (#14424)

* fix TestIndexWriterWithThreads#testIOExceptionDuringWriteSegmentWithThreadsOnlyOnce

Signed-off-by: guojialiang <[email protected]>

* fix TestIndexWriterWithThreads#testIOExceptionDuringWriteSegmentWithThreadsOnlyOnce

Signed-off-by: guojialiang <[email protected]>

* update

Signed-off-by: guojialiang <[email protected]>

---------

Signed-off-by: guojialiang <[email protected]>
jpountz pushed a commit to jpountz/lucene that referenced this pull request Apr 24, 2025
…nlyOnce (apache#14424)

* fix TestIndexWriterWithThreads#testIOExceptionDuringWriteSegmentWithThreadsOnlyOnce

Signed-off-by: guojialiang <[email protected]>

* fix TestIndexWriterWithThreads#testIOExceptionDuringWriteSegmentWithThreadsOnlyOnce

Signed-off-by: guojialiang <[email protected]>

* update

Signed-off-by: guojialiang <[email protected]>

---------

Signed-off-by: guojialiang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants