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

Mukul Gupta edited comment on FLINK-39909 at 6/11/26 6:38 AM:
--------------------------------------------------------------

I'm already working on this with a fix ready. Could someone assign this to me?

[~fanrui]  — I've reproduced this locally and have a fix + test. Would you be 
able to review?


was (Author: JIRAUSER312410):
I am already working on this, can someone please assign this Jira to me? 

[~fanrui] can you please review this i have been able to reproduce this on my 
local.

> Heap state backend savepoint fails with NPE when MapState contains null values
> ------------------------------------------------------------------------------
>
>                 Key: FLINK-39909
>                 URL: https://issues.apache.org/jira/browse/FLINK-39909
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Checkpointing, Runtime / State Backends
>            Reporter: Mukul Gupta
>            Priority: Major
>
> Found while investigating FLINK-38144.
> HeapKeyValueStateIterator unconditionally calls 
> userValueSerializer.serialize(userValue, valueOut) after writing thenull 
> flag, causing NPE during canonical savepoint when MapState contains null 
> values with null-unsafe serializers (IntSerializer, LongSerializer, 
> BooleanSerializer, etc.).
> Code path:
> https://github.com/apache/flink/blob/master/flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapKeyValueStateIterator.java#365
> Same asymmetric pattern fixed for RocksDB/ForSt in FLINK-38137. Only affects 
> canonical savepoints — heap checkpoints use MapSerializer.serialize() which 
> handles nulls internally.
> Fix: skip serializer call when value is null (matching the deserialization 
> side which already checks the null flag).



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

Reply via email to