gyowoo1113 opened a new pull request, #5312:
URL: https://github.com/apache/zeppelin/pull/5312

   ### What is this PR for?
   `Resource.serializeObject(Object)` caught serialization exceptions, printed 
the stack trace, and still returned a `ByteBuffer` from the partially written 
output. When serialization failed, callers could receive truncated or empty 
data instead of the original `IOException`.
   
   This PR removes the exception-swallowing catch block and uses 
try-with-resources for `ObjectOutputStream`. Serialization failures now 
propagate as the already-declared `IOException`, allowing the existing 
caller-side error handling to run and preventing invalid buffers from being 
returned.
   
   A unit test was added with a `Serializable` object that throws `IOException` 
during serialization. The method signature and behavior for valid serializable 
objects are unchanged.
   
   
   ### What type of PR is it?
   Bug Fix
   
   ### Todos
   * [x] Remove the exception-swallowing catch block
   * [x] Remove `printStackTrace()`
   * [x] Propagate serialization failures as `IOException`
   * [x] Use try-with-resources for `ObjectOutputStream`
   * [x] Add a regression test for serialization failure
   
   ### What is the Jira issue?
   [ZEPPELIN-6467](https://issues.apache.org/jira/browse/ZEPPELIN-6467)
   
   ### How should this be tested?
   `./mvnw test -pl zeppelin-interpreter -Dtest=ResourceTest` passes 
successfully.
   
   To verify that the shaded interpreter JAR includes the change:
   
   `./mvnw clean package -pl zeppelin-interpreter,zeppelin-interpreter-shaded 
-DskipTests` passes successfully.
   
   ### Screenshots (if appropriate)
   N/A
   
   ### Questions:
   * Does the license files need to update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   


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