You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Nico Kruber (JIRA)" <ji...@apache.org> on 2018/07/05 10:25:01 UTC

[jira] [Resolved] (FLINK-9676) Deadlock during canceling task and recycling exclusive buffer

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

Nico Kruber resolved FLINK-9676.
--------------------------------
    Resolution: Fixed

Fixed via
1.6.0: a9b5579b397b6c56e44e21ebb8b2a6a7e6d8b2d1
1.5.0: 6ce8211bab84308a17043dc4901d6a93b2777da8

> Deadlock during canceling task and recycling exclusive buffer
> -------------------------------------------------------------
>
>                 Key: FLINK-9676
>                 URL: https://issues.apache.org/jira/browse/FLINK-9676
>             Project: Flink
>          Issue Type: Bug
>          Components: Network
>    Affects Versions: 1.5.0
>            Reporter: zhijiang
>            Assignee: Nico Kruber
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 1.6.0, 1.5.1
>
>
> It may cause deadlock between task canceler thread and task thread.
> The detail is as follows:
> {{Task canceler thread -> IC1#releaseAllResources -> recycle floating buffers -> {color:#d04437}lock{color}(LocalBufferPool#availableMemorySegments) -> IC2#notifyBufferAvailable}} > {color:#d04437}try to lock{color}(IC2#bufferQueue)
> {{Task thread -> IC2#recycle -> {color:#d04437}lock{color}(IC2#bufferQueue) -> bufferQueue#addExclusiveBuffer}} -> {{floatingBuffer#recycleBuffer}} -> {color:#d04437}try to lock{color}(LocalBufferPool#availableMemorySegments)
> One solution is that {{listener#notifyBufferAvailable}} can be called outside the {{synchronized(availableMemorySegments) in }}{{LocalBufferPool#recycle.}}
> The existing RemoteInputChannelTest#testConcurrentOnSenderBacklogAndRecycle can cover this case but the deadlock probability is very low, so this UT is not stable.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)