-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Acquire seacher on closing engine should throw AlreadyClosedException #33331
Conversation
Pinging @elastic/es-distributed |
This reverts commit ce635f5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM left one comment.
* the searcher is acquired. */ | ||
store.incRef(); | ||
Releasable releasable = store::decRef; | ||
ensureOpen(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we doing this just for cosmetic reasons? because if we can't inc the store we will fail here with IllegalStateException
if we don't want to do this we should maybe use if (store.tryIncRef())
and if we can't throw an already closed Exception? I jsut wanna make sure this is known that this is best effort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice suggestion. I replaced it with tryIncRef
.
Thanks @s1monw. |
Closes #33330