Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-9324] Wait for slot release before completing release future i…
…n SingleLogicalSlot This commit properly waits for the completion of the SingleLogicalSlot's release future until the SlotOwner has acknowledged the release. That way the ExecutionGraph will only recover after all of its slots have been returned to the SlotPool. As a side effect, the changes in this commit should reduce the number of redundant release calls sent to the SlotOwner which cluttered the debug logs. This closes #5980.
- Loading branch information
1 parent
3c86b6b
commit c7eb6ac
Showing
10 changed files
with
498 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ | |
* an AllocatedSlot was allocated to the JobManager as soon as the TaskManager registered at the | ||
* JobManager. All slots had a default unknown resource profile. | ||
*/ | ||
public class AllocatedSlot implements SlotContext { | ||
class AllocatedSlot implements SlotContext { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tillrohrmann
Author
Contributor
|
||
|
||
/** The ID under which the slot is allocated. Uniquely identifies the slot. */ | ||
private final AllocationID allocationId; | ||
|
@@ -171,21 +171,13 @@ public boolean tryAssignPayload(Payload payload) { | |
* then it is removed from the slot. | ||
* | ||
* @param cause of the release operation | ||
* @return true if the payload could be released and was removed from the slot, otherwise false | ||
*/ | ||
public boolean releasePayload(Throwable cause) { | ||
public void releasePayload(Throwable cause) { | ||
final Payload payload = payloadReference.get(); | ||
|
||
if (payload != null) { | ||
if (payload.release(cause)) { | ||
payloadReference.set(null); | ||
|
||
return true; | ||
} else { | ||
return false; | ||
} | ||
} else { | ||
return true; | ||
payload.release(cause); | ||
payloadReference.set(null); | ||
} | ||
} | ||
|
||
|
@@ -222,12 +214,10 @@ public String toString() { | |
interface Payload { | ||
|
||
/** | ||
* Releases the payload. If the payload could be released, then it returns true, | ||
* otherwise false. | ||
* Releases the payload | ||
* | ||
* @param cause of the payload release | ||
* @return true if the payload could be released, otherwise false | ||
*/ | ||
boolean release(Throwable cause); | ||
void release(Throwable cause); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
@tillrohrmann What is the purpose to change access level here?