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

Don't wait joinThread when stopping #8359

Closed
wants to merge 2 commits into from

Conversation

bleskes
Copy link
Contributor

@bleskes bleskes commented Nov 6, 2014

When a node stops, we cancel any ongoing join process. With #8327, we improved this logic and wait for it to complete before shutting down the node. However, the joining thread is part of a thread pool and will not stop until the thread pool is shutdown.

Another issue raised by the unneeded wait is that when we shutdown, we may ping ourselves - which results in an ugly warn level log. We now log all remote exception during pings at a debug level.

When a node stops, we cancel any ongoing join process. With elastic#8327, we improved this logic and wait for it to complete before shutting down the node. In our tests we typically shutdown an entire cluster at once, which makes it very likely for nodes to be joining while shutting down. This introduces a race condition where the joinThread.interrupt can happen before the thread starts waiting on pings which causes shutdown logic to be slow. This commits improves by repeatedly trying to stop the thread in smaller waits.

Another side effect of the change is that we are now more likely to ping ourselves while shutting down, we results in an ugly warn level log. We now log all remote exception during pings at a debug level.
@martijnvg
Copy link
Member

LGTM

@bleskes bleskes closed this in 83d9dab Nov 6, 2014
@bleskes
Copy link
Contributor Author

bleskes commented Nov 6, 2014

pull request took the wrong approach. I reverted it from master and re-opening.

@bleskes bleskes reopened this Nov 6, 2014
@bleskes bleskes changed the title Discovery: a more lenient wait joinThread when stopping Discovery: don't wait joinThread when stopping Nov 6, 2014
@martijnvg
Copy link
Member

LGTM

@bleskes bleskes closed this in 9192219 Nov 7, 2014
bleskes added a commit that referenced this pull request Nov 7, 2014
When a node stops, we cancel any ongoing join process. With #8327, we improved this logic and wait for it to complete before shutting down the node. However, the joining thread is part of a thread pool and will not stop until the thread pool is shutdown.

Another issue raised by the unneeded wait is that when we shutdown, we may ping ourselves - which results in an ugly warn level log. We now log all remote exception during pings at a debug level.

Closes #8359
@s1monw
Copy link
Contributor

s1monw commented Dec 9, 2014

@bleskes should we push this to 1.4 too? We just timed out on a node here:

http://build-us-00.elasticsearch.org/job/es_core_14_suse/144/

bleskes added a commit that referenced this pull request Dec 11, 2014
When a node stops, we cancel any ongoing join process. With #8327, we improved this logic and wait for it to complete before shutting down the node. In our tests we typically shutdown an entire cluster at once, which makes it very likely for nodes to be joining while shutting down. This introduces a race condition where the joinThread.interrupt can happen before the thread starts waiting on pings which causes shutdown logic to be slow. This commits improves by repeatedly trying to stop the thread in smaller waits.

Another side effect of the change is that we are now more likely to ping ourselves while shutting down, we results in an ugly warn level log. We now log all remote exception during pings at a debug level.

Closes #8359
@bleskes bleskes added the v1.4.2 label Dec 11, 2014
@bleskes
Copy link
Contributor Author

bleskes commented Dec 11, 2014

@s1monw done.

@s1monw
Copy link
Contributor

s1monw commented Dec 11, 2014

thx

@clintongormley clintongormley changed the title Discovery: don't wait joinThread when stopping Discovery: Don't wait joinThread when stopping Dec 16, 2014
@clintongormley clintongormley added :Distributed/Discovery-Plugins Anything related to our integration plugins with EC2, GCP and Azure and removed :Core/Infra/Core Core issues without another label labels Jun 6, 2015
@clintongormley clintongormley changed the title Discovery: Don't wait joinThread when stopping Don't wait joinThread when stopping Jun 6, 2015
mute pushed a commit to mute/elasticsearch that referenced this pull request Jul 29, 2015
When a node stops, we cancel any ongoing join process. With elastic#8327, we improved this logic and wait for it to complete before shutting down the node. In our tests we typically shutdown an entire cluster at once, which makes it very likely for nodes to be joining while shutting down. This introduces a race condition where the joinThread.interrupt can happen before the thread starts waiting on pings which causes shutdown logic to be slow. This commits improves by repeatedly trying to stop the thread in smaller waits.

Another side effect of the change is that we are now more likely to ping ourselves while shutting down, we results in an ugly warn level log. We now log all remote exception during pings at a debug level.

Closes elastic#8359
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Discovery-Plugins Anything related to our integration plugins with EC2, GCP and Azure >enhancement v1.4.2 v1.5.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants