Skip to content

Conversation

@original-brownbear
Copy link
Contributor

Use the action listener response handler in a couple additional spots to get proper toString that make slow logging easier to interpret if needed and to save some LoC and duplication.

Use the action listener response handler in a couple additional spots
to get proper `toString` that make slow logging easier to interpret if
needed and to save some LoC and duplication.
@original-brownbear original-brownbear added >non-issue :Distributed Coordination/Network Http and internode communication implementations v8.6.0 labels Oct 14, 2022
@elasticsearchmachine elasticsearchmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Oct 14, 2022
@elasticsearchmachine
Copy link
Collaborator

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

public class ActionListenerResponseHandler<Response extends TransportResponse> implements TransportResponseHandler<Response> {

private final ActionListener<? super Response> listener;
protected final ActionListener<? super Response> listener;
Copy link
Contributor

@idegtiarenko idegtiarenko Oct 18, 2022

Choose a reason for hiding this comment

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

Is this change required? It looks like all of the updated usages are referencing the same listener that is passed in constructor or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This way we save a reference in some, because we don't have to capture listener twice (once in the variable and once in the anonymous capture). We have the same approach in ActionRunnable so I did it here also to save some references (if only to make heap dumps easier to grind through :D).

Copy link
Contributor

@idegtiarenko idegtiarenko left a comment

Choose a reason for hiding this comment

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

Left a comment, otherwise LGTM

@original-brownbear
Copy link
Contributor Author

Thanks Ievgen!

@original-brownbear original-brownbear merged commit 06008a4 into elastic:main Oct 18, 2022
@original-brownbear original-brownbear deleted the more-transport-response-listener-fixes branch October 18, 2022 12:04
@original-brownbear original-brownbear restored the more-transport-response-listener-fixes branch April 18, 2023 20:54
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 Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants