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

Kezhu Wang commented on FLINK-20580:
------------------------------------

Hi [~trohrmann], after digging a bit, I think we had third option: not 
supporting nullable value for {{SerializedValue(T value)}}.

Caller should resort to nullable/optional variable of {{SerializedValue}} if 
null-ability is required, just like 
{{JobCheckpointingSettings.defaultStateBackend}}.

I saw two null-ability dependencies of {{SerializedValue(T value)}} so far:
 * {{rpc.akka}}. As an rpc module, I think it would be better to use its own 
version for self-contained. If there is an rpc returning {{SerializedValue}}, 
it will fail as {{AkkaInvocationHandler.deserializeValueIfNeeded}} treats the 
value as wrapped result. Not sure whether this is a valid case, but there are 
already cases where {{SerializedValue}} used as parameter.
 * 
{{TaskExecutorOperatorEventHandlingTest.eventHandlingInTaskFailureFailsTask}}. 
It is easy to fix.

To sum up, the third option should be:
 * Forbid null value in {{SerializedValue(T value)}}.
 * Migrate existing null-ability dependent code.
 
[~trohrmann] Which approach do you prefer ?

> Missing null value handling for SerializedValue's getByteArray() 
> -----------------------------------------------------------------
>
>                 Key: FLINK-20580
>                 URL: https://issues.apache.org/jira/browse/FLINK-20580
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Type Serialization System
>    Affects Versions: 1.13.0
>            Reporter: Matthias
>            Assignee: Kezhu Wang
>            Priority: Minor
>              Labels: pull-request-available, starter
>
> {{SerializedValue}} allows to wrap {{null}} values. Because of this, 
> {{SerializedValue.getByteArray()}} might return {{null}} which is not 
> properly handled in different locations (it's probably the best to use the 
> IDEs "Find usages" to identify these locations). The most recent findings 
> (for now) are listed in the comments.
> We should add null handling in these cases and add tests for these cases.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to