File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
network-common/src/main/java/org/apache/spark/network
network-yarn/src/main/java/org/apache/spark/network/yarn Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -333,4 +333,8 @@ public Meter getChunkFetchRequestHandleSuccessRate() {
333333 public Meter getChunkFetchRequestHandleFailRate () {
334334 return chunkFetchRequestHandleFailRate ;
335335 }
336+
337+ public long getChunksBeingTransferred () {
338+ return rpcHandler .getStreamManager ().chunksBeingTransferred ();
339+ }
336340}
Original file line number Diff line number Diff line change @@ -166,7 +166,8 @@ private String findHeaviestShuffle() {
166166 * HIGH_CONGESTION --> NO_CONGESTION
167167 */
168168 private void checkCongestion () {
169- int requestPendingTasks = transportContext .getPendingTasks ();
169+ int requestPendingTasks =
170+ transportContext .getPendingTasks () + (int )streamManager .chunksBeingTransferred ();
170171 CongestionMode prevMode = congestionMode ;
171172 if (requestPendingTasks <= lowWaterMark ) {
172173 congestionMode = CongestionMode .NO ;
Original file line number Diff line number Diff line change @@ -207,6 +207,9 @@ protected void serviceInit(Configuration conf) throws Exception {
207207 blockHandler .getAllMetrics ().getMetrics ().put ("numNettyIOPendingTasks" ,
208208 (Gauge ) () -> shuffleServer .getPendingTasks ());
209209
210+ blockHandler .getAllMetrics ().getMetrics ().put ("chunksBeingTransferred" ,
211+ (Gauge ) () -> transportContext .getChunksBeingTransferred ());
212+
210213 blockHandler .getAllMetrics ().getMetrics ().put ("numNettyChunkFetchPendingTasks" ,
211214 (Gauge ) () -> transportContext .getPendingTasks ());
212215
You can’t perform that action at this time.
0 commit comments