-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Do not block transport thread on startup #44939
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pinging @elastic/es-distributed |
original-brownbear
approved these changes
Jul 29, 2019
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 (assuming tests go green). I think this is the way to go, if this is causing tests to fail we should fix those test. I'm completely +1 to the blocking on the IO thread being horrible.
Jenkins run elasticsearch-ci/2 |
ywelsch
added a commit
that referenced
this pull request
Jul 29, 2019
We currently block the transport thread on startup, which has caused test failures. I think this is some kind of deadlock situation. I don't think we should even block a transport thread, and there's also no need to do so. We can just reject requests as long we're not fully set up. Note that the HTTP layer is only started much later (after we've completed full start up of the transport layer), so that one should be completely unaffected by this. Closes #41745
ywelsch
added a commit
that referenced
this pull request
Jul 29, 2019
Adapted test to take non-blocking nature into account.
ywelsch
added a commit
that referenced
this pull request
Jul 29, 2019
Adapted test to take non-blocking nature into account.
jkakavas
pushed a commit
that referenced
this pull request
Jul 31, 2019
We currently block the transport thread on startup, which has caused test failures. I think this is some kind of deadlock situation. I don't think we should even block a transport thread, and there's also no need to do so. We can just reject requests as long we're not fully set up. Note that the HTTP layer is only started much later (after we've completed full start up of the transport layer), so that one should be completely unaffected by this. Closes #41745
jkakavas
pushed a commit
that referenced
this pull request
Jul 31, 2019
Adapted test to take non-blocking nature into account.
DaveCTurner
added a commit
to DaveCTurner/elasticsearch
that referenced
this pull request
Feb 26, 2021
Today we bind to our transport address(es) very early in the startup of a node so that we know the addresses to which we're bound, even though we are not yet ready to handle any requests. If we receive a request in this state then we throw an `IllegalStateException` which results in a logged warning and the connection being closed. In practice, this happens straight away since the first request on the connection, the handshake, is sent as soon as it's open. With this commit we instead quietly close the connection straight away, even before any requests are received, avoiding the noisy logging. Relates elastic#44939 Relates elastic#16746 Closes elastic#61356
DaveCTurner
added a commit
to DaveCTurner/elasticsearch
that referenced
this pull request
Mar 1, 2021
Today we bind to our transport address(es) very early in the startup of a node so that we know the addresses to which we're bound, even though we are not yet ready to handle any requests. If we receive a request in this state then we throw an `IllegalStateException` which results in a logged warning and the connection being closed. In practice, this happens straight away since the first request on the connection, the handshake, is sent as soon as it's open. This commit introduces a `TransportNotReadyException` for this specific case, and suppresses the noisy logging on such exceptions. Relates elastic#44939 Relates elastic#16746 Closes elastic#61356
DaveCTurner
added a commit
that referenced
this pull request
Mar 1, 2021
Today we bind to our transport address(es) very early in the startup of a node so that we know the addresses to which we're bound, even though we are not yet ready to handle any requests. If we receive a request in this state then we throw an `IllegalStateException` which results in a logged warning and the connection being closed. In practice, this happens straight away since the first request on the connection, the handshake, is sent as soon as it's open. This commit introduces a `TransportNotReadyException` for this specific case, and suppresses the noisy logging on such exceptions. Relates #44939 Relates #16746 Closes #61356
DaveCTurner
added a commit
that referenced
this pull request
Mar 1, 2021
Today we bind to our transport address(es) very early in the startup of a node so that we know the addresses to which we're bound, even though we are not yet ready to handle any requests. If we receive a request in this state then we throw an `IllegalStateException` which results in a logged warning and the connection being closed. In practice, this happens straight away since the first request on the connection, the handshake, is sent as soon as it's open. This commit introduces a `TransportNotReadyException` for this specific case, and suppresses the noisy logging on such exceptions. Relates #44939 Relates #16746 Closes #61356
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
:Distributed Coordination/Network
Http and internode communication implementations
>non-issue
v7.4.0
v8.0.0-alpha1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We currently block the transport thread on startup. For example, the test failure linked by this comment: #41071 (comment), which is different to the other ones on that issue, shows both transport threads (there are only two with MockNioTransport) being blocked on the latch, somehow not allowing the startup phase to complete. I think this is some kind of deadlock situation. I don't think we should even block a transport thread, and there's also no need to do so. We can just reject requests as long we're not fully set up. Note that the HTTP layer is only started much later (after we've completed full start up of the transport layer), so that one should be completely unaffected by this.
Closes #41745