zhaowq32 commented on PR #10376: URL: https://github.com/apache/seatunnel/pull/10376#issuecomment-3798151261
> ### MAJOR: getJobProgressInformation() method lacks null checks for the sinkMetrics list and its elements, which may lead to a NullPointerException > **Location**: `seatunnel-engine/seatunnel-engine-client/src/main/java/org/apache/seatunnel/engine/client/job/JobClient.java` > > **Problem Description**: The code directly iterates over the sinkMetrics list and calls metric.getWriteCount(), without checking: 1) whether sinkMetrics itself is null; 2) whether elements in the list are null. In certain abnormal scenarios (such as Job initialization failure), this may lead to NPE. > > **Impact**: In production environments, if abnormal situations cause sinkMetrics to be null or contain null elements, a NullPointerException will be thrown, causing progress information retrieval to fail and affecting monitoring log output and troubleshooting. All Jobs using the Zeta engine may be affected. Thanks for the review. I’d like to clarify that the current implementation already handles null-related edge cases safely. The metrics are parsed via getJobMetricsSummary(), which includes explicit null checks on JSON nodes and wraps the entire parsing logic in a try–catch that also covers NullPointerException. In abnormal scenarios (e.g. job initialization failure or incomplete metrics), the method will return a valid JobMetricsSummary instead of throwing an exception. Therefore, even if sink-related metrics are missing or partially invalid, progress retrieval and monitoring will not fail in production. -- 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]
