You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by fa...@apache.org on 2025/04/07 07:41:14 UTC

(flink) branch master updated: [hotfix] Avoid duplicate get memory segment size (#26367)

This is an automated email from the ASF dual-hosted git repository.

fanrui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new a80d71f638b [hotfix] Avoid duplicate get memory segment size (#26367)
a80d71f638b is described below

commit a80d71f638b93efc0f5f6dd3aa04bf712b4689b1
Author: Jiaan Geng <be...@163.com>
AuthorDate: Mon Apr 7 15:41:08 2025 +0800

    [hotfix] Avoid duplicate get memory segment size (#26367)
---
 .../taskmanager/NettyShuffleEnvironmentConfiguration.java      | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NettyShuffleEnvironmentConfiguration.java b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NettyShuffleEnvironmentConfiguration.java
index c33cd9b219d..5b1582c6b8c 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NettyShuffleEnvironmentConfiguration.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NettyShuffleEnvironmentConfiguration.java
@@ -304,7 +304,8 @@ public class NettyShuffleEnvironmentConfiguration {
                         configuration,
                         localTaskManagerCommunication,
                         taskManagerAddress,
-                        dataBindPortRange);
+                        dataBindPortRange,
+                        pageSize);
 
         final int numberOfNetworkBuffers =
                 calculateNumberOfNetworkBuffers(networkMemorySize, pageSize);
@@ -454,6 +455,8 @@ public class NettyShuffleEnvironmentConfiguration {
      * @param taskManagerAddress identifying the IP address under which the TaskManager will be
      *     accessible
      * @param dataPortRange data port range for communication and data exchange
+     * @param memorySegmentSize size of memory buffers used by the network stack and the memory
+     *     manager
      * @return the netty configuration or {@code null} if communication is in the same task manager
      */
     @Nullable
@@ -461,7 +464,8 @@ public class NettyShuffleEnvironmentConfiguration {
             Configuration configuration,
             boolean localTaskManagerCommunication,
             InetAddress taskManagerAddress,
-            PortRange dataPortRange) {
+            PortRange dataPortRange,
+            int memorySegmentSize) {
 
         final NettyConfig nettyConfig;
         if (!localTaskManagerCommunication) {
@@ -472,7 +476,7 @@ public class NettyShuffleEnvironmentConfiguration {
                     new NettyConfig(
                             taskManagerInetSocketAddress.getAddress(),
                             dataPortRange,
-                            ConfigurationParserUtils.getPageSize(configuration),
+                            memorySegmentSize,
                             ConfigurationParserUtils.getSlot(configuration),
                             configuration);
         } else {