Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-43118][SS] Remove unnecessary assert for UninterruptibleThread in KafkaMicroBatchStream #40767

Closed
wants to merge 2 commits into from

Conversation

jerrypeng
Copy link
Contributor

@jerrypeng jerrypeng commented Apr 13, 2023

What changes were proposed in this pull request?

The assert

assert(Thread.currentThread().isInstanceOf[UninterruptibleThread])

found https://github.com/apache/spark/blob/master/connector/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchStream.scala#L239

is not needed. The reason is the following

  1. This assert was put there due to some issues when the old and deprecated KafkaOffsetReaderConsumer is used. The default offset reader implementation has been changed to KafkaOffsetReaderAdmin which no longer require it run via UninterruptedThread.
  2. Even if the deprecated KafkaOffsetReaderConsumer is used, there are already asserts in that impl to check if it is running via UninterruptedThread e.g. https://github.com/apache/spark/blob/master/connector/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaOffsetReaderConsumer.scala#L130 thus the assert in KafkaMicroBatchStream is redundant.

Why are the changes needed?

Remove unnecessary assert. Clean up code.

Does this PR introduce any user-facing change?

No

How was this patch tested?

n/a

@HeartSaVioR HeartSaVioR changed the title [SPARK-43118] Remove unnecessary assert for UninterruptibleThread in KafkaMicroBatchStream [SPARK-43118][SS] Remove unnecessary assert for UninterruptibleThread in KafkaMicroBatchStream Apr 13, 2023
Copy link
Contributor

@HeartSaVioR HeartSaVioR left a comment

Choose a reason for hiding this comment

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

+1 pending CI.

@HeartSaVioR
Copy link
Contributor

Thanks! Merging to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants