Skip to content

Conversation

@hailin0
Copy link
Member

@hailin0 hailin0 commented Apr 23, 2025

Purpose of this pull request

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

@hailin0
Copy link
Member Author

hailin0 commented Apr 23, 2025

image

@hailin0 hailin0 marked this pull request as ready for review April 23, 2025 08:36
@hailin0 hailin0 requested a review from Copilot April 23, 2025 08:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a potential NullPointerException in the Kafka enumerator's split assignment logic by adding initialization state checks.

  • Introduces a volatile boolean flag (initialized) to control when discovery and assignment of splits should occur.
  • Updates the discovery logic in open() and the registration logic in registerReader() to respect the new initialization state.
Comments suppressed due to low confidence (1)

seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceSplitEnumerator.java:262

  • [nitpick] Adding 'initialized' to the condition in registerReader() ensures no premature split assignment. Please confirm that this check does not inadvertently delay processing of pending splits when readers are registered.
if (!pendingSplit.isEmpty() && initialized) {

Copy link
Contributor

@zhilinli123 zhilinli123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@wuchunfu wuchunfu merged commit 7ca0c0c into apache:dev Apr 26, 2025
6 checks passed
jia17 pushed a commit to jia17/seatunnel that referenced this pull request Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants