Bonnie Varghese created FLINK-38992:
---------------------------------------

             Summary: Defining a state ttl on NonTime Over Windows leads to 
NullPointerException
                 Key: FLINK-38992
                 URL: https://issues.apache.org/jira/browse/FLINK-38992
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Runtime
    Affects Versions: 2.1.1, 2.2.0
            Reporter: Bonnie Varghese
            Assignee: Bonnie Varghese
             Fix For: 2.3.0


The non-time over windows uses the following states:
 # accMapState
 # valueMapState
 # valueState
 # idState

All of the above mentioned states defines a TTL independently. This causes 
state for a key to be cleared from one of the states while the other contains 
it leading to NullPointerException. To fix this, make the state cleanup atomic 
by cleaning up all the associated states for a key.

 

StackTrace:
{code:java}
java.lang.NullPointerException
        at UnboundedOverAggregateHelper$9.accumulate(Unknown Source)
        at 
org.apache.flink.table.runtime.operators.over.NonTimeRangeUnboundedPrecedingFunction.processRemainingElements(NonTimeRangeUnboundedPrecedingFunction.java:540)
        at 
org.apache.flink.table.runtime.operators.over.NonTimeRangeUnboundedPrecedingFunction.insertIntoSortedList(NonTimeRangeUnboundedPrecedingFunction.java:355)
        at 
org.apache.flink.table.runtime.operators.over.NonTimeRangeUnboundedPrecedingFunction.processElement(NonTimeRangeUnboundedPrecedingFunction.java:280)
        at 
org.apache.flink.table.runtime.operators.over.NonTimeRangeUnboundedPrecedingFunction.processElement(NonTimeRangeUnboundedPrecedingFunction.java:99)
        at 
org.apache.flink.streaming.api.operators.KeyedProcessOperator.processElement(KeyedProcessOperator.java:87)
        at 
org.apache.flink.streaming.runtime.io.RecordProcessorUtils.lambda$getRecordProcessor$0(RecordProcessorUtils.java:64)
        at 
org.apache.flink.streaming.runtime.tasks.OneInputStreamTask$StreamTaskNetworkOutput.emitRecord(OneInputStreamTask.java:253)
        at 
org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.processElement(AbstractStreamTaskNetworkInput.java:206)
        at 
org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.emitNext(AbstractStreamTaskNetworkInput.java:163)
        at 
org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:65)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:654)
        at 
org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:231)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:1007)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:944)
        at 
org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:1083)
        at 
org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:1065)
        at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:860)
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:664)
        at java.base/java.lang.Thread.run(Thread.java:1583) {code}



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

Reply via email to