Skip to content
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

CompletionStats can cause resource leak since requested searchers are not closed #3652

Closed
s1monw opened this Issue Sep 9, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@s1monw
Copy link
Contributor

s1monw commented Sep 9, 2013

I found this very sneaky problem while hunting a couple of other problems that I thought are related to potentially not closed index readers etc. I added support for MockDirectoryWrapper and the completion stats blew up immediately. While I might need more time to fully integrate the MockDirectoryWrapper from Lucene I want to fix this obvious bug first...

@ghost ghost assigned s1monw Sep 9, 2013

s1monw added a commit to s1monw/elasticsearch that referenced this issue Sep 9, 2013

Only pull searcher once during completion stats
The inner call to the completion stats pulled a second searcher
that never got released causing the underlying readers to never
get closed unless the node is shut down. This was triggered
with literally each stats call including the completion stats
even if no completion service was used on the index.

Closes elastic#3652
@s1monw

This comment has been minimized.

Copy link
Contributor Author

s1monw commented Sep 9, 2013

the completion stats was using searcher().reader() but should have used searcher.reader() causing the seachers reference to be incremented but never decremented

@drewr

This comment has been minimized.

Copy link
Member

drewr commented Sep 9, 2013

That's amazing! 🤘

@s1monw s1monw closed this in 76cc8c3 Sep 9, 2013

s1monw added a commit that referenced this issue Sep 9, 2013

Only pull searcher once during completion stats
The inner call to the completion stats pulled a second searcher
that never got released causing the underlying readers to never
get closed unless the node is shut down. This was triggered
with literally each stats call including the completion stats
even if no completion service was used on the index.

Closes #3652

s1monw added a commit that referenced this issue Sep 9, 2013

Rename IndexShard#searcher() to #acquireSearcher()
Based on recent bugs ( #3652 ) where searchers were acquired multiple times
but never released 'IndexShard#searcher()' has not a more accurate name.

Closes #3653

s1monw added a commit that referenced this issue Sep 9, 2013

Rename IndexShard#searcher() to #acquireSearcher()
Based on recent bugs ( #3652 ) where searchers were acquired multiple times
but never released 'IndexShard#searcher()' has not a more accurate name.

Closes #3653

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Only pull searcher once during completion stats
The inner call to the completion stats pulled a second searcher
that never got released causing the underlying readers to never
get closed unless the node is shut down. This was triggered
with literally each stats call including the completion stats
even if no completion service was used on the index.

Closes elastic#3652

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Rename IndexShard#searcher() to #acquireSearcher()
Based on recent bugs ( elastic#3652 ) where searchers were acquired multiple times
but never released 'IndexShard#searcher()' has not a more accurate name.

Closes elastic#3653
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.