kunalmnnit opened a new pull request, #3764:
URL: https://github.com/apache/avro/pull/3764

   ## Summary
   
   - `UnresolvedUnionException` previously included the full `toString()` of 
the unresolved datum in its exception message. When this exception propagates 
to generic error handlers (e.g. in Kafka Connect runtime's `WorkerTask`), the 
datum value — which may contain sensitive user data — gets written to log files.
   - Replace the datum's `toString()` with its class name in the exception 
message. The actual datum object remains accessible via `getUnresolvedDatum()` 
for callers that need programmatic access.
   
   ## Motivation
   
   In Kafka Connect, when an `UnresolvedUnionException` is thrown during 
serialization/deserialization, it bubbles up to `WorkerTask.run()` which logs 
the full exception message at ERROR level. Since the message contains the raw 
datum value, this results in customer/user data being written to application 
logs — a data leak.
   
   The fix is minimal and backwards-compatible:
   - The exception message now shows the **type** of the datum (e.g. 
`java.lang.Integer`) instead of its **value**
   - The `getUnresolvedDatum()` accessor still returns the original object for 
any caller that needs the actual value
   
   ## Test plan
   
   - [x] Updated existing test 
`TestGenericDatumWriter.unionUnresolvedExceptionExplicitWhichField` to assert 
new message format
   - [x] All 15 tests in `TestGenericDatumWriter` pass


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