ayalamark-afk opened a new pull request, #21368:
URL: https://github.com/apache/kafka/pull/21368

   ## Summary
   
   Fix for KAFKA-17676 - NullPointerException when starting tasks after the 
connect-configs topic has been compacted.
   
   ## Problem
   
   When the connect-configs topic gets compacted, connector config records can 
be removed even though the connector is still active. The fix for KAFKA-16838 
assumes that if a connector config is missing, the connector was deleted, and 
ignores task configs. This causes an NPE when trying to start tasks:
   
   java.lang.NullPointerException: Cannot invoke "java.util.Map.size()" because 
"inputMap" is null
       at org.apache.kafka.connect.runtime.TaskConfig.<init>
       at org.apache.kafka.connect.runtime.Worker.startTask
   
   ## Solution
   
   Distinguish between two scenarios in processTasksCommitRecord:
   
   1. Connector was truly deleted (no deferred updates, not previously applied) 
→ Ignore task configs (preserves KAFKA-16838 fix)
   
   2. Connector config was compacted but connector is still active → Use 
previously applied config if available, or mark as inconsistent
   
   This prevents NPE crashes while maintaining backward compatibility with the 
KAFKA-16838 fix.
   


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