You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/05/30 08:52:13 UTC

[GitHub] [flink] carp84 commented on a change in pull request #8570: [FLINK-11987] [state] Make serializer lazy initialization thread safe in StateDescriptor

carp84 commented on a change in pull request #8570: [FLINK-11987] [state] Make serializer lazy initialization thread safe in StateDescriptor
URL: https://github.com/apache/flink/pull/8570#discussion_r288909836
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java
 ##########
 @@ -82,8 +87,7 @@
 	/** The serializer for the type. May be eagerly initialized in the constructor,
 	 * or lazily once the {@link #initializeSerializerUnlessSet(ExecutionConfig)} method
 	 * is called. */
-	@Nullable
-	protected TypeSerializer<T> serializer;
+	private final AtomicReference<TypeSerializer<T>> serializerAtomicReference = new AtomicReference<>();
 
 Review comment:
   Yes if we aim at making `StateDescriptor` thread safe but that would be a bigger project and requires more testing.
   
   Considering the seemingly fact that reset `queryableStateName` or `ttlConfig` won't cause obvious trouble, does it make sense if we fix the serializer lazy initialization issue (which has caused a NPE problem on kafka producer) first and then check whether it worth another JIRA/PR for making the whole `StateDescriptor` thread safe? Thanks.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services