Github user StephanEwen commented on a diff in the pull request:
https://github.com/apache/flink/pull/4916#discussion_r148360937
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
---
@@ -126,9 +134,11 @@
/** A future that completes once the Execution reaches a terminal
ExecutionState */
private final CompletableFuture<ExecutionState> terminationFuture;
+ private final CompletableFuture<TaskManagerLocation>
taskManagerLocationFuture;
+
private volatile ExecutionState state = CREATED;
- private volatile SimpleSlot assignedResource; // once assigned,
never changes until the execution is archived
+ private final AtomicReference<SimpleSlot> assignedResource;
--- End diff --
Minor comment: Since the resource is accessed quite frequently, using a
volatile variable with an `AtomicReferenceFieldUpdater` could be good here.
---