Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-6474

Potential loss of precision in 32 bit integer multiplication

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: Network
    • Labels:
      None

      Description

      In TaskManagerServicesConfiguration#parseNetworkEnvironmentConfiguration

          if (!hasNewNetworkBufConf(configuration)) {
            // map old config to new one:
            networkBufMin = networkBufMax = numNetworkBuffers * pageSize;
      

      networkBufMax is a long.
      However the multiplication is done in 32 bit integer, leading to potential loss of precision.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user tedyu opened a pull request:

          https://github.com/apache/flink/pull/3839

          FLINK-6474 Potential loss of precision in 32 bit integer multiplication

          Cast numNetworkBuffers to long before multiplication.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/tedyu/flink master

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/flink/pull/3839.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #3839


          commit 3f35aab20f4f0c3b11dbee3cfd5bbbe0249a9aa5
          Author: tedyu <yuzhihong@gmail.com>
          Date: 2017-05-07T19:20:27Z

          FLINK-6474 Potential loss of precision in 32 bit integer multiplication


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user tedyu opened a pull request: https://github.com/apache/flink/pull/3839 FLINK-6474 Potential loss of precision in 32 bit integer multiplication Cast numNetworkBuffers to long before multiplication. You can merge this pull request into a Git repository by running: $ git pull https://github.com/tedyu/flink master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3839.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3839 commit 3f35aab20f4f0c3b11dbee3cfd5bbbe0249a9aa5 Author: tedyu <yuzhihong@gmail.com> Date: 2017-05-07T19:20:27Z FLINK-6474 Potential loss of precision in 32 bit integer multiplication
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user tedyu commented on the issue:

          https://github.com/apache/flink/pull/3839

          @StefanRRichter
          Can you take a look ?

          Show
          githubbot ASF GitHub Bot added a comment - Github user tedyu commented on the issue: https://github.com/apache/flink/pull/3839 @StefanRRichter Can you take a look ?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user StefanRRichter commented on the issue:

          https://github.com/apache/flink/pull/3839

          LGTM +1, will merge.

          Show
          githubbot ASF GitHub Bot added a comment - Github user StefanRRichter commented on the issue: https://github.com/apache/flink/pull/3839 LGTM +1, will merge.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user StefanRRichter commented on the issue:

          https://github.com/apache/flink/pull/3839

          Merged manually in 38003c2829. Please close this PR and the jira.

          Show
          githubbot ASF GitHub Bot added a comment - Github user StefanRRichter commented on the issue: https://github.com/apache/flink/pull/3839 Merged manually in 38003c2829. Please close this PR and the jira.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user tedyu closed the pull request at:

          https://github.com/apache/flink/pull/3839

          Show
          githubbot ASF GitHub Bot added a comment - Github user tedyu closed the pull request at: https://github.com/apache/flink/pull/3839

            People

            • Assignee:
              yuzhihong@gmail.com Ted Yu
              Reporter:
              yuzhihong@gmail.com Ted Yu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development