-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-19113][SS][Tests]Set UncaughtExceptionHandler in onQueryStarted to ensure catching fatal errors during query initialization #16492
Conversation
…al errors during query initialization
Test build #70995 has finished for PR 16492 at commit
|
Test build #70998 has finished for PR 16492 at commit
|
@@ -238,7 +238,7 @@ class StreamSuite extends StreamTest { | |||
} | |||
} | |||
|
|||
testQuietly("fatal errors from a source should be sent to the user") { | |||
testQuietly("handle fatal errors thrown from the stream thread correctly") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correctly
is superfluous and could be removed.
@@ -235,7 +235,10 @@ trait StreamTest extends QueryTest with SharedSQLContext with Timeouts { | |||
*/ | |||
def testStream( | |||
_stream: Dataset[_], | |||
outputMode: OutputMode = OutputMode.Append)(actions: StreamAction*): Unit = { | |||
outputMode: OutputMode = OutputMode.Append)(actions: StreamAction*): Unit = synchronized { | |||
// `synchronized` is added to prevent the user from calling `testStream` concurrently because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate why StreamingQueryListener
can be used concurrently? I'm reading the comment: "it does not work because something else does not work". Why? What's wrong with StreamingQueryListener
?
Test build #71086 has finished for PR 16492 at commit
|
Merged to master |
…ed to ensure catching fatal errors during query initialization ## What changes were proposed in this pull request? StreamTest sets `UncaughtExceptionHandler` after starting the query now. It may not be able to catch fatal errors during query initialization. This PR uses `onQueryStarted` callback to fix it. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes #16492 from zsxwing/SPARK-19113.
I also cherry-picked to 2.1 since Jenkins also run 2.1 tests. |
…waitInitialization to avoid breaking tests ## What changes were proposed in this pull request? #16492 missed one race condition: `StreamExecution.awaitInitialization` may throw fatal errors and fail the test. This PR just ignores `StreamingQueryException` thrown from `awaitInitialization` so that we can verify the exception in the `ExpectFailure` action later. It's fine since `StopStream` or `ExpectFailure` will catch `StreamingQueryException` as well. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes #16567 from zsxwing/SPARK-19113-2. (cherry picked from commit c050c12) Signed-off-by: Shixiong Zhu <[email protected]>
…waitInitialization to avoid breaking tests ## What changes were proposed in this pull request? apache#16492 missed one race condition: `StreamExecution.awaitInitialization` may throw fatal errors and fail the test. This PR just ignores `StreamingQueryException` thrown from `awaitInitialization` so that we can verify the exception in the `ExpectFailure` action later. It's fine since `StopStream` or `ExpectFailure` will catch `StreamingQueryException` as well. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes apache#16567 from zsxwing/SPARK-19113-2.
…ed to ensure catching fatal errors during query initialization ## What changes were proposed in this pull request? StreamTest sets `UncaughtExceptionHandler` after starting the query now. It may not be able to catch fatal errors during query initialization. This PR uses `onQueryStarted` callback to fix it. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes apache#16492 from zsxwing/SPARK-19113.
…waitInitialization to avoid breaking tests ## What changes were proposed in this pull request? apache#16492 missed one race condition: `StreamExecution.awaitInitialization` may throw fatal errors and fail the test. This PR just ignores `StreamingQueryException` thrown from `awaitInitialization` so that we can verify the exception in the `ExpectFailure` action later. It's fine since `StopStream` or `ExpectFailure` will catch `StreamingQueryException` as well. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes apache#16567 from zsxwing/SPARK-19113-2.
…ed to ensure catching fatal errors during query initialization ## What changes were proposed in this pull request? StreamTest sets `UncaughtExceptionHandler` after starting the query now. It may not be able to catch fatal errors during query initialization. This PR uses `onQueryStarted` callback to fix it. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes apache#16492 from zsxwing/SPARK-19113.
…waitInitialization to avoid breaking tests ## What changes were proposed in this pull request? apache#16492 missed one race condition: `StreamExecution.awaitInitialization` may throw fatal errors and fail the test. This PR just ignores `StreamingQueryException` thrown from `awaitInitialization` so that we can verify the exception in the `ExpectFailure` action later. It's fine since `StopStream` or `ExpectFailure` will catch `StreamingQueryException` as well. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes apache#16567 from zsxwing/SPARK-19113-2.
What changes were proposed in this pull request?
StreamTest sets
UncaughtExceptionHandler
after starting the query now. It may not be able to catch fatal errors during query initialization. This PR usesonQueryStarted
callback to fix it.How was this patch tested?
Jenkins