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

Core: changing refresh_interval to non-positive (0, -1, etc.) value might cause 100% CPU spin #8085

Closed
mikemccand opened this Issue Oct 15, 2014 · 0 comments

Comments

Projects
None yet
2 participants
@mikemccand
Copy link
Contributor

mikemccand commented Oct 15, 2014

As reported on the user's list:

https://groups.google.com/d/msg/elasticsearch/IQWvod8hq_Q/H6358j_24B0J

It looks like there is a concurrency bug when you dynamically update refresh_interval down to a value <= 0. We cancel the scheduled future when this happens, but if the future was already executing (which we don't try to cancel because we pass false to the cancel call), EngineRefresher.run will then forever continue rescheduling itself for the immediate future.

@mikemccand mikemccand self-assigned this Oct 15, 2014

mikemccand added a commit to mikemccand/elasticsearch that referenced this issue Oct 15, 2014

Core: only schedule another refresh if refresh_interval is positive
If a refresh was already running when the refresh_interval is
dynamically updated down to a non-positive value (0, -1, etc.), then
it's was possible for the refresh thread to go into while (true)
refresh() loop.

Closes elastic#8085

@s1monw s1monw added v1.4.0 and removed v1.4.0.Beta1 labels Oct 15, 2014

mikemccand added a commit that referenced this issue Oct 15, 2014

Core: don't spin 100% CPU when disabling refresh_interval
If refresh was already running when the refresh_interval is
dynamically disabled (set to a non-positive value like 0, -1, etc.),
then it's possible for the refresh thread to go into while (true)
refresh() loop.

Closes #8085

Closes #8087

mikemccand added a commit that referenced this issue Oct 15, 2014

Core: don't spin 100% CPU when disabling refresh_interval
If refresh was already running when the refresh_interval is
dynamically disabled (set to a non-positive value like 0, -1, etc.),
then it's possible for the refresh thread to go into while (true)
refresh() loop.

Closes #8085

Closes #8087

mikemccand added a commit that referenced this issue Oct 15, 2014

Core: don't spin 100% CPU when disabling refresh_interval
If refresh was already running when the refresh_interval is
dynamically disabled (set to a non-positive value like 0, -1, etc.),
then it's possible for the refresh thread to go into while (true)
refresh() loop.

Closes #8085

Closes #8087

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

Core: don't spin 100% CPU when disabling refresh_interval
If refresh was already running when the refresh_interval is
dynamically disabled (set to a non-positive value like 0, -1, etc.),
then it's possible for the refresh thread to go into while (true)
refresh() loop.

Closes elastic#8085

Closes elastic#8087

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

Core: don't spin 100% CPU when disabling refresh_interval
If refresh was already running when the refresh_interval is
dynamically disabled (set to a non-positive value like 0, -1, etc.),
then it's possible for the refresh thread to go into while (true)
refresh() loop.

Closes elastic#8085

Closes elastic#8087
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.