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/05 12:14:00 UTC

[jira] [Closed] (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 closed FLINK-15905.
--------------------------------

> 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
>            Assignee: Stephan Ewen
>            Priority: Blocker
>              Labels: pull-request-available
>             Fix For: 1.10.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> There is a race condition around releasing an {{OpaqueMemoryResource}} obtained via {{MemoryManager.getSharedMemoryResourceForManagedMemory}}.
> {code}
> final boolean allDisposed = sharedResources.release(type, leaseHolder);
> if (allDisposed) {
> 	releaseMemory(type, MemoryType.OFF_HEAP, size);
> }
> {code}
> 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.



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