flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-8226) Dangling reference generated after NFA clean up timed out SharedBufferEntry
Date Mon, 01 Jan 2018 04:11:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-8226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16307367#comment-16307367
] 

ASF GitHub Bot commented on FLINK-8226:
---------------------------------------

Github user dianfu commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5141#discussion_r159149194
  
    --- Diff: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java
---
    @@ -191,22 +191,28 @@ public boolean isEmpty() {
     	 */
     	public boolean prune(long pruningTimestamp) {
     		Iterator<Map.Entry<K, SharedBufferPage<K, V>>> iter = pages.entrySet().iterator();
    -		boolean pruned = false;
    +		List<SharedBufferEntry<K, V>> prunedEntries = new ArrayList<>();
     
     		while (iter.hasNext()) {
     			SharedBufferPage<K, V> page = iter.next().getValue();
     
    -			if (page.prune(pruningTimestamp)) {
    -				pruned = true;
    -			}
    +			page.prune(pruningTimestamp, prunedEntries);
     
     			if (page.isEmpty()) {
     				// delete page if it is empty
     				iter.remove();
     			}
     		}
     
    -		return pruned;
    +		if (!prunedEntries.isEmpty()) {
    +			for (Map.Entry<K, SharedBufferPage<K, V>> entry : pages.entrySet()) {
    +				entry.getValue().removeEdges(prunedEntries);
    +			}
    +			prunedEntries.clear();
    --- End diff --
    
    Updated.


> Dangling reference generated after NFA clean up timed out SharedBufferEntry
> ---------------------------------------------------------------------------
>
>                 Key: FLINK-8226
>                 URL: https://issues.apache.org/jira/browse/FLINK-8226
>             Project: Flink
>          Issue Type: Bug
>          Components: CEP
>            Reporter: Dian Fu
>            Assignee: Dian Fu
>             Fix For: 1.5.0, 1.4.1
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message