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

Simplify OutboundHandler #72442

Merged

Conversation

original-brownbear
Copy link
Member

The whole serializer class adds nothing but complexity. Simplified it away
to make this code easier to read while saving some objects as well and making
the slow warning serialize slightly cleaner to read.

The whole serializer class adds nothing but complexity. Simplified it away
to make this code easier to read while saving some objects as well and making
the slow warning serialize slightly nicer.
@original-brownbear original-brownbear added >non-issue :Distributed/Network Http and internode communication implementations v8.0.0 v7.14.0 labels Apr 29, 2021
@elasticmachine elasticmachine added the Team:Distributed Meta label for distributed team label Apr 29, 2021
@elasticmachine
Copy link
Collaborator

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

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.

Couple more cleanup suggestions; also I'd prefer to call this a >refactoring rather than a >non-issue.

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

private void internalSend(TcpChannel channel, BytesReference reference, @Nullable OutboundMessage message,
ActionListener<Void> listener) {
final long startTime = threadPool.relativeTimeInMillis();
channel.getChannelStats().markAccessed(startTime);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we just fixed a small bug here in that we used to mark the channel as accessed before doing the serialisation, so if the serialisation failed then we'd delay the next ping without having sent anything else over the wire. No longer a problem ✅

final long startTime = threadPool.relativeTimeInMillis();
channel.getChannelStats().markAccessed(startTime);
final long messageSize = reference.length();
TransportLogger.logOutboundMessage(channel, reference);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this also fixes a small bug in that the tracer will log outbound pings now. Could argue it either way, but given that we logged inbound pings already I think this makes sense ✅

@original-brownbear original-brownbear merged commit 988ca73 into elastic:master Apr 29, 2021
@original-brownbear original-brownbear deleted the cleaner-outbound-handler branch April 29, 2021 10:56
@original-brownbear
Copy link
Member Author

Thanks David :)

chengyang14 pushed a commit to chengyang14/elasticsearch that referenced this pull request May 7, 2021
The whole serializer class adds nothing but complexity. Simplified it away
to make this code easier to read while saving some objects as well and making
the slow warning serialize slightly nicer.
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Jun 29, 2021
The whole serializer class adds nothing but complexity. Simplified it away
to make this code easier to read while saving some objects as well and making
the slow warning serialize slightly nicer.
original-brownbear added a commit that referenced this pull request Jun 29, 2021
The whole serializer class adds nothing but complexity. Simplified it away
to make this code easier to read while saving some objects as well and making
the slow warning serialize slightly nicer.
BytesReference reference = sendContext.get();
private void internalSend(TcpChannel channel, BytesReference reference, @Nullable OutboundMessage message,
ActionListener<Void> listener) {
final long startTime = threadPool.relativeTimeInMillis();
Copy link
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Network Http and internode communication implementations >refactoring Team:Distributed Meta label for distributed team v7.14.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants