You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Stephan Ewen (Jira)" <ji...@apache.org> on 2020/02/04 19:58:00 UTC

[jira] [Updated] (FLINK-15905) Fix Race Condition when releasing shared memory resource

     [ https://issues.apache.org/jira/browse/FLINK-15905?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Ewen updated FLINK-15905:
---------------------------------
    Description: 
There is a race condition around releasing the memory in MemoryManager.

final boolean allDisposed = sharedResources.release(type, leaseHolder);
if (allDisposed) {
	releaseMemory(type, MemoryType.OFF_HEAP, size);
}
If another allocation occurs while the releasing thread is between the "sharedResources.release"and the "if block", then there is no resource to pick up any more and memory has not yet been returned to the memory bookkeeping.
Looks like a legitimate bug.

> Fix Race Condition when releasing shared memory resource
> --------------------------------------------------------
>
>                 Key: FLINK-15905
>                 URL: https://issues.apache.org/jira/browse/FLINK-15905
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Task
>            Reporter: Stephan Ewen
>            Priority: Critical
>             Fix For: 1.10.0
>
>
> There is a race condition around releasing the memory in MemoryManager.
> final boolean allDisposed = sharedResources.release(type, leaseHolder);
> if (allDisposed) {
> 	releaseMemory(type, MemoryType.OFF_HEAP, size);
> }
> If another allocation occurs while the releasing thread is between the "sharedResources.release"and the "if block", then there is no resource to pick up any more and memory has not yet been returned to the memory bookkeeping.
> Looks like a legitimate bug.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)