-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Remove some overhead from TransportService message handling #124428
Remove some overhead from TransportService message handling #124428
Conversation
Avoiding some indirection, volatile-reads and moving the listener functionality that needlessly kept iterating an empty CoW list (creating iterator instances, volatile reads, more code) in an effort to improve the low IPC on transport threads.
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
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 makes sense to me. Couple of nits.
@@ -32,7 +33,7 @@ protected boolean addMockHttpTransport() { | |||
|
|||
@Override | |||
protected Collection<Class<? extends Plugin>> nodePlugins() { | |||
return List.of(AsyncSearch.class); | |||
return List.of(AsyncSearch.class, MockTransportService.TestPlugin.class); |
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.
I'd prefer we added these things to super.nodePlugins()
with appendToCopy
or similar. Doesn't really matter in this case right now but adding stuff to ESIntegTestCase#nodePlugins
everywhere for an experiment is sometimes handy.
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.
Makes sense :) done :)
Optional<Throwable> throwable = ExceptionsHelper.unwrapCausesAndSuppressed(error, t -> t.getStackTrace().length > 0); | ||
transportMessageHasStackTrace.set(throwable.isPresent()); | ||
internalCluster.getDataNodeInstances(TransportService.class) | ||
.forEach(ts -> ((MockTransportService) ts).addMessageListener(new TransportMessageListener() { |
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.
Suggest asInstanceOf(MockTransportService.class, ts)
, we sometimes catch a ClassCastException
without failing the test.
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.
++
Thanks David! |
💔 Backport failed
You can use sqren/backport to manually backport by running |
Avoiding some indirection, volatile-reads and moving the listener functionality that needlessly kept iterating an empty CoW list (creating iterator instances, volatile reads, more code) in an effort to improve the low IPC on transport threads.