GitHub user zhijiangW opened a pull request:

    [FLINK-8747][bugfix] The tag of waiting for floating buffers in 
RemoteInputChannel should be updated properly

    ## What is the purpose of the change
    *In credit-based flow control mode, when the number of available buffers is 
less than required buffers (backlog + initialCredit), the `RemoteInputChannel` 
will request floating buffers from `BufferProvider`. If not get enough 
available floating buffers, the `RemoteInputChannel` registers itself as 
listener in `BufferProvider` and updates the tag `isWaitingForFloatingBuffers` 
as true to avoid registration repeatedly.*
     *When a floating buffer is recycled to `BufferProvider`, it will notify 
the listener of available buffer. But the listener may not need floating 
buffers currently if the available buffers is not less than required buffers, 
then the floating buffers will be returned to BufferProvider directly. Most 
importantly, the tag `isWaitingForFloatingBuffers` should also be updated as 
false, otherwise the `RemoteInputChannel` will not request floating buffers any 
more after the available buffers less than required buffers.*
    *There are two scenarios for causing the above issue:*
    - The recycled exclusive buffers increase the total available buffers which 
is equal to or more than required buffers.
    - The decreased sender's backlog resulting the available buffers equal to 
required buffers.
    ## Brief change log
      - *Updates the tag `isWaitingForFloatingBuffers` false on 
`notifyBufferAvailable` if current available buffers is not less than required 
    ## Verifying this change
    This change added tests and can be verified as follows:
      - *Modify 
`RemoteInputChannelTest#testAvailableBuffersLessThanRequiredBuffers to cover 
this case*
    ## Does this pull request potentially affect one of the following parts:
      - Dependencies (does it add or upgrade a dependency): (no)
      - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (no)
      - The serializers: (no)
      - The runtime per-record code paths (performance sensitive): (no)
      - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
      - The S3 file system connector: (no)
    ## Documentation
      - Does this pull request introduce a new feature? (no)
      - If yes, how is the feature documented? (not applicable)

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

    $ git pull FLINK-8747

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

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

    This closes #5558
commit 10ad6db14d072a5208c45c4be08624ebd7e8ea13
Author: Zhijiang <wangzhijiang999@...>
Date:   2018-02-22T14:41:38Z

    [FLINK-8747][bugfix] The tag of waiting for floating buffers in 
RemoteInputChannel should be updated properly



Reply via email to