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

Rui Fan resolved FLINK-40667.
-----------------------------
    Fix Version/s: 2.4.0
       Resolution: Fixed

Merged to master(2.4.0) via: be7d380841364dd4d0493000db1bec9c13f21d85

> Buffer ref-count leaks in CDR recovery filtering end in free() on a live 
> segment
> --------------------------------------------------------------------------------
>
>                 Key: FLINK-40667
>                 URL: https://issues.apache.org/jira/browse/FLINK-40667
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Runtime / Checkpointing
>            Reporter: Rui Fan
>            Assignee: Rui Fan
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.4.0
>
>
> `recover()` retains the source buffer via `retainBuffer()` at the call site, 
> before `segmentSerializerFor` (arg5) and 
> `ChannelStateFilteringHandler.filterAndRewrite`'s two early throws run — any 
> of which orphans the extra reference, so refCnt never reaches 0 and 
> `closeInternal()` later `free()`s a segment still held by a live 
> `NetworkBuffer`. 
> Fix: move the `retainBuffer()` down to the dispatcher's delegation into the 
> inner `GateFilterHandler` (whose `sourceBufferOwnershipTransferred` guard 
> already recycles on throw), so every earlier throw runs before ownership is 
> transferred.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to