-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
LUCENE-9164: Ignore ACE on tragic event if IW is closed #1215
Conversation
@mikemccand @jpountz Would you mind taking a look? Thank you. |
I don't think we should change the behavior here. If we move away from treating a ACE as fatal here we are missing important verification. ACE should not be thrown anywhere where we treat exceptions as fatal for instance during a merge, in a refresh / flush, inside DWPT etc. If IW is closed due to any kind of event we make sure that we prevent threads from entering DWPT, issue new flush / refreshes and stop all merges. A tragic event does the same thing such that if we hit ACE in a critical place it's highly likely that's a bug. So I think we should keep the logic as it is? |
The problem is that The lifecycle around these components seems a bit ill-defined, I therefore wonder if something more contained, like the following, would be an option:
|
I think you are confusing something here. |
The simplest way to reproduce the issue is to run I also added a bit more log output to show the stack trace:
This results in the following exception:
showing how the IndexWriter is closed while |
Thanks @ywelsch I think I understand the issue here. From my perspective there are some issues in how we ensure that there are no other threads modifying IW while we are closing / aborting. In oder to ensure that we clean up all resources we opened ie. open files etc. we need to harden this more that it is today. I think during rollback we must ensure that no other thread is modifying the writer anymore. We already to that in several places but I wonder if we need to streamline this more with some thing like a semaphore that has |
I will start working on some refactorings to streamline this. |
Closes in favor of #1319. |
If an IndexWriter was closed, then AlreadyClosedException should not be considered a tragic event.