Skip to content

Conversation

original-brownbear
Copy link
Contributor

@original-brownbear original-brownbear commented Dec 27, 2021

Removing the mock nio transport and replacing its usage with the Netty transport to make tests
with a more realistic transport implementation. This way improves the real world coverage for
the Netty transport, makes our tests more realistic and saves lots of code.
In particular, coverage on the rather complicated throttling/chunking in the Netty message handler
is really ice to have.
The downside of this change is that we lose the slow transport thread warnings that the mock transport
outputs. This isn't a big deal these days in my opinion as we have slow logging in other places
now that makes up for this (we didn't when initially adding the slow logging) and that contains
far more detailed information on what exactly was slow.
Other than that, the mock transport does not come with any features we don't also have in the Netty
transport at this point.

Removing the mock nio transport and replacing its usage with the netty transport to make tests
with a more realistic transport implementation. This way improves the real world coverage for
the Netty transport, makes our tests more realistic and saves lots of code.
In particular, coverage on the rather complicated throttling/chunking in the netty message handler
is really ice to have.
The downside of this change is that we lose the slow transport thread warnings that the mock transport
outputs. This isn't a big deal these days in my opinion as we have slow logging in other places
now that makes up for this (we didn't when initially adding the slow logging) and that contains
far more detailed information on what exactly was slow.
Other than that, the mock transport does not come with any features we don't also have in the Netty
transport at this point.
@original-brownbear original-brownbear added >test Issues or PRs that are addressing/adding tests :Delivery/Build Build or test infrastructure :Distributed Coordination/Network Http and internode communication implementations v8.0.0 v8.1.0 labels Dec 27, 2021
@elasticmachine elasticmachine added Team:Delivery Meta label for Delivery team Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. labels Dec 27, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

Copy link
Contributor

@pugnascotia pugnascotia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build changes LGTM.

Releasables.close(() -> {
if (channel.isOpen()) {
try {
channel.config().setOption(ChannelOption.SO_LINGER, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this brings back the logging mentioned in #82360 - I think we need to drop Connection reset logs to DEBUG if transport.netty.rst_on_close is set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right It does ... looking into a way that adjusts the level (slightly tricky to find a nice way) ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright worked around this now by adding a setting for all transports (though only Netty does pick it up). Not super happy with the approach but it works. We could also go with just a static boolean via a property but I tend to rather make things work out of the box in my idea :D

Copy link
Contributor

@arteam arteam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@original-brownbear
Copy link
Contributor Author

Jenkins run elasticsearch-ci/part-1 (unrelated + known)

@original-brownbear
Copy link
Contributor Author

@DaveCTurner @henningandersen ping if you have a second, this needs a little broader consensus :)

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, suggested a few extra words in comments in a couple of places.

@original-brownbear
Copy link
Contributor Author

Thanks everyone!

@original-brownbear original-brownbear merged commit 0b66c14 into elastic:master Jan 17, 2022
@original-brownbear original-brownbear deleted the netty-in-tests branch January 17, 2022 11:34
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.0 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 82088

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Delivery/Build Build or test infrastructure :Distributed Coordination/Network Http and internode communication implementations Team:Delivery Meta label for Delivery team Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. >test Issues or PRs that are addressing/adding tests v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants