abdullah alamoudi has submitted this change and it was merged. Change subject: [NO ISSUE][LOG] Include destination IP in thread name on push back ......................................................................
[NO ISSUE][LOG] Include destination IP in thread name on push back - user model changes: no - storage format changes: no - interface changes: no Details: - In certain cases, we noticed that threads of certain jobs are waiting on the network boundaries to send tuples. - In that case and in a big cluster, it is difficult to tell which node is pushing back. - To make this easy, we include the IP of the receiving node in the thread name. Change-Id: I81b48cb7a79de0a37f2171a1bd3b82141f89b49d Reviewed-on: https://asterix-gerrit.ics.uci.edu/2929 Sonar-Qube: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> Contrib: Jenkins <[email protected]> Reviewed-by: Murtadha Hubail <[email protected]> Integration-Tests: Jenkins <[email protected]> (cherry picked from commit 2498d28f0584d6ab002625417622be429f5c8131) Reviewed-on: https://asterix-gerrit.ics.uci.edu/2942 --- M hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java M hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java M hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelSet.java M hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/MultiplexedConnection.java 4 files changed, 25 insertions(+), 1 deletion(-) Approvals: Anon. E. Moose #1000171: Jenkins: Verified; No violations found; Verified Murtadha Hubail: Looks good to me, approved diff --git a/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java b/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java index 334fb5c..261e7c4 100644 --- a/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java +++ b/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java @@ -18,9 +18,11 @@ */ package org.apache.hyracks.comm.channels; +import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.util.ArrayDeque; import java.util.Deque; +import java.util.Objects; import org.apache.hyracks.api.comm.IBufferAcceptor; import org.apache.hyracks.api.comm.IFrameWriter; @@ -75,7 +77,15 @@ break; } try { - wait(); + InetSocketAddress remoteAddress = ccb.getRemoteAddress(); + String nameBefore = Thread.currentThread().getName(); + try { + Thread.currentThread() + .setName(nameBefore + ":SendingTo(" + Objects.toString(remoteAddress) + ")"); + wait(); + } finally { + Thread.currentThread().setName(nameBefore); + } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw HyracksDataException.create(e); diff --git a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java index 998acfb..f7ef2aa 100644 --- a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java +++ b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java @@ -19,6 +19,7 @@ package org.apache.hyracks.net.protocols.muxdemux; import java.io.IOException; +import java.net.InetSocketAddress; import java.nio.channels.SocketChannel; import java.util.concurrent.atomic.AtomicBoolean; @@ -163,4 +164,8 @@ + " remoteClose: " + remoteClose + " remoteCloseAck:" + remoteCloseAck + " readCredits: " + ri.getCredits() + " writeCredits: " + wi.getCredits() + "]"; } + + public InetSocketAddress getRemoteAddress() { + return cSet.getMultiplexedConnection().getRemoteAddress(); + } } diff --git a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelSet.java b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelSet.java index 31a37ef..f5cdf2c 100644 --- a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelSet.java +++ b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelSet.java @@ -239,4 +239,8 @@ ccbArray = Arrays.copyOf(ccbArray, ccbArray.length * 2); } } + + public MultiplexedConnection getMultiplexedConnection() { + return mConn; + } } diff --git a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/MultiplexedConnection.java b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/MultiplexedConnection.java index b6a392e..4c3836a 100644 --- a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/MultiplexedConnection.java +++ b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/MultiplexedConnection.java @@ -19,6 +19,7 @@ package org.apache.hyracks.net.protocols.muxdemux; import java.io.IOException; +import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; @@ -437,4 +438,8 @@ } } } + + public InetSocketAddress getRemoteAddress() { + return tcpConnection == null ? null : tcpConnection.getRemoteAddress(); + } } \ No newline at end of file -- To view, visit https://asterix-gerrit.ics.uci.edu/2942 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I81b48cb7a79de0a37f2171a1bd3b82141f89b49d Gerrit-PatchSet: 2 Gerrit-Project: asterixdb Gerrit-Branch: stabilization-f69489 Gerrit-Owner: abdullah alamoudi <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]> Gerrit-Reviewer: abdullah alamoudi <[email protected]>
