1fanwang commented on code in PR #65956:
URL: https://github.com/apache/airflow/pull/65956#discussion_r3184645559


##########
java-sdk/sdk/src/main/kotlin/org/apache/airflow/sdk/execution/TaskSdkFrames.kt:
##########
@@ -0,0 +1,254 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.airflow.sdk.execution
+
+import com.fasterxml.jackson.databind.DeserializationFeature
+import com.fasterxml.jackson.databind.ObjectMapper
+import com.fasterxml.jackson.databind.SerializationFeature
+import com.fasterxml.jackson.databind.util.StdDateFormat
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
+import org.apache.airflow.sdk.execution.api.model.ConnectionResponse
+import org.apache.airflow.sdk.execution.api.model.VariableResponse
+import org.apache.airflow.sdk.execution.api.model.XComResponse
+import org.msgpack.core.MessagePack
+import java.io.ByteArrayOutputStream
+import java.io.EOFException
+import java.io.InputStream
+import java.io.OutputStream
+
+typealias TaskSdkMessageDecoder = (Map<*, *>) -> Any
+
+object TaskSdkFrames {
+  private val mapper =
+    ObjectMapper().apply {
+      configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)

Review Comment:
   cross posting from mailing list discussion
   
   Worth a comment somewhere calling out that this is load-bearing — it's
   what makes Core's IPC schema forward-compatible (additive field              
                                                                                
              
   changes don't break Java consumers).                                         
                                                                                
              
                                                                                
                                                                                
              
   I've watched the analogous trap fire in a different Python-server /          
                                                                                
              
   generated-Java-client setup: the codegen emitted its own                     
                                                                                
              
   pre-Jackson whitelist check (validateJsonElement throwing       
   IllegalArgumentException on unknown fields), so a benign additive            
                                                                                
              
   field on the server response broke every Java consumer regardless            
                                                                                
              
   of how the downstream Jackson mapper was configured. Took a                  
                                                                                
              
   coordinated client-version bump to recover.                                  
                                                                                
              
                                                                                
                                                                                
              
   Since FAIL_ON_UNKNOWN_PROPERTIES=false here is what prevents the             
                                                                                
              
   analogous issue between the supervisor and the Java task runtime,            
                                                                                
              
   worth a short comment so it doesn't get accidentally flipped, and            
                                                                                
              
   worth elevating to an explicit contract in ADR 0003



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to