liuml07 opened a new pull request, #29230:
URL: https://github.com/apache/flink/pull/29230

   This supersedes #26776, which was automatically closed as stale, and the 
earlier #24205.
   
   JIRA: https://issues.apache.org/jira/browse/FLINK-34251
   
   ## What is the purpose of the change
   
   `ClosureCleaner` reports the nested non-serializable object, but complex 
jobs may reference that object through several operators and third-party 
classes. The current exception does not show how the object is reached.
   
   This change adds the traversed field path to the exception using the 
established Java/Spark serialization-debugging format, for example:
   
   ```
   java.lang.Object@... is not serializable.
   Reference path:
       - object not serializable (class: java.lang.Object)
       - field (class: com.mycompany.LocalMap, name: delegate, type: class 
java.lang.Object)
       - field (class: com.mycompany.ComplexMap, name: map4, type: class 
com.mycompany.LocalMap)
   ```
   
   ## Brief change log
   
   - Track fields while recursively cleaning nested objects.
   - Report the offending class and each field's declaring class, name, and 
type, from leaf to root.
   - Restore the diagnostic path reliably when recursive cleaning exits.
   - Add coverage in `ClosureCleanerTest`.
   
   ## Verifying this change
   
   `ClosureCleanerTest` covers the nested failure and validates the ordered 
class-and-field path. All 16 tests in the class pass with Java 17. Checkstyle 
and Java formatting checks pass for the changed files.
   
   ## Does this pull request potentially affect one of the following parts:
   
   - Dependencies (does it add or upgrade a dependency): no
   - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: no
   - The serializers: no
   - The runtime per-record code paths (performance sensitive): no
   - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
   - The S3 file system connector: no
   
   ## Documentation
   
   - Does this pull request introduce a new feature? no
   - If yes, how is the feature documented? not applicable
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Pi 0.85.1
   


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