GitHub user tillrohrmann opened a pull request:
https://github.com/apache/flink/pull/5354
[FLINK-8505] [flip6] Prevent SlotManager from reaching an inconsistent state
## What is the purpose of the change
The SlotManager could reach an inconsistent state when a formerly free slot
is reported
to be allocated by an incoming SlotReport. This state transition did not
remove the slot
from the set of free slots. As a consequence, a now allocated slot will be
considered for
future SlotRequests. This caused a failure with an IllegalStateException.
The problem is solved by removing an updated slot which is now allocated
from the set of
free slots.
## Brief change log
- Remove slot from `SlotManager#freeSlots` when slot is reported to be
`ALLOCATED` instead of `FREE`
## Verifying this change
- Added `SlotManagerTest#testReportAllocatedSlot`
## 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: (yes)
- 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 https://github.com/tillrohrmann/flink fixSlotManagerInconsistency
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/5354.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 #5354
----
commit 329bbb0e3bf7600054e865acf69c63187d04b4a0
Author: Till Rohrmann <trohrmann@...>
Date: 2018-01-24T17:32:47Z
[FLINK-8505] [flip6] Prevent SlotManager from reaching an inconsistent state
The SlotManager could reach an inconsistent state when a formerly free slot
is reported
to be allocated by an incoming SlotReport. This state transition did not
remove the slot
from the set of free slots. As a consequence, a now allocated slot will be
considered for
future SlotRequests. This caused a failure with an IllegalStateException.
The problem is solved by removing an updated slot which is now allocated
from the set of
free slots.
----
---