-
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-23838][WEBUI] Running SQL query is displayed as "completed" in SQL tab #20955
Conversation
Test build #88790 has finished for PR 20955 at commit
|
@vanzin Please help review this. |
b418feb
to
2357f59
Compare
Test build #88795 has finished for PR 20955 at commit
|
@@ -39,7 +39,7 @@ private[ui] class AllExecutionsPage(parent: SQLTab) extends WebUIPage("") with L | |||
val failed = new mutable.ArrayBuffer[SQLExecutionUIData]() | |||
|
|||
sqlStore.executionsList().foreach { e => | |||
val isRunning = e.jobs.exists { case (_, status) => status == JobExecutionStatus.RUNNING } | |||
val isRunning = e.completionTime.isEmpty |
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.
I think you actually need both checks. The code in 2.2 is this:
if (executionUIData.completionTime.nonEmpty && !executionUIData.hasRunningJobs) {
// We are the last job of this execution, so mark the execution as finished. Note that
// `onExecutionEnd` also does this, but currently that can be called before `onJobEnd`
// since these are called on different threads.
markExecutionFinished(executionId)
}
The original reason why this code is like this is that job events and sql execution events could arrive out of order; I don't know if that is still true, but I tried to maintain the same workarounds in the new code.
If the out-of-order issue exists, then your change would introduce the opposite problem: an execution marked as completed when existing known jobs are still running, because the execution end event arrived before the job end event.
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.
Make sense. I have updated the code.
2357f59
to
ceb28eb
Compare
Test build #88841 has finished for PR 20955 at commit
|
retest this please |
Test build #88857 has finished for PR 20955 at commit
|
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.
LGTM
Merging to master / 2.3. |
… SQL tab ## What changes were proposed in this pull request? A running SQL query would appear as completed in the Spark UI:  We can see the query in "Completed queries", while in in the job page we see it's still running Job 132.  After some time in the query still appears in "Completed queries" (while it's still running), but the "Duration" gets increased.  To reproduce, we can run a query with multiple jobs. E.g. Run TPCDS q6. The reason is that updates from executions are written into kvstore periodically, and the job start event may be missed. ## How was this patch tested? Manually run the job again and check the SQL Tab. The fix is pretty simple. Author: Gengliang Wang <[email protected]> Closes #20955 from gengliangwang/jobCompleted. (cherry picked from commit d8379e5) Signed-off-by: Marcelo Vanzin <[email protected]>
… SQL tab ## What changes were proposed in this pull request? A running SQL query would appear as completed in the Spark UI:  We can see the query in "Completed queries", while in in the job page we see it's still running Job 132.  After some time in the query still appears in "Completed queries" (while it's still running), but the "Duration" gets increased.  To reproduce, we can run a query with multiple jobs. E.g. Run TPCDS q6. The reason is that updates from executions are written into kvstore periodically, and the job start event may be missed. ## How was this patch tested? Manually run the job again and check the SQL Tab. The fix is pretty simple. Author: Gengliang Wang <[email protected]> Closes apache#20955 from gengliangwang/jobCompleted.
… SQL tab ## What changes were proposed in this pull request? A running SQL query would appear as completed in the Spark UI:  We can see the query in "Completed queries", while in in the job page we see it's still running Job 132.  After some time in the query still appears in "Completed queries" (while it's still running), but the "Duration" gets increased.  To reproduce, we can run a query with multiple jobs. E.g. Run TPCDS q6. The reason is that updates from executions are written into kvstore periodically, and the job start event may be missed. ## How was this patch tested? Manually run the job again and check the SQL Tab. The fix is pretty simple. Author: Gengliang Wang <[email protected]> Closes apache#20955 from gengliangwang/jobCompleted.
… SQL tab A running SQL query would appear as completed in the Spark UI:  We can see the query in "Completed queries", while in in the job page we see it's still running Job 132.  After some time in the query still appears in "Completed queries" (while it's still running), but the "Duration" gets increased.  To reproduce, we can run a query with multiple jobs. E.g. Run TPCDS q6. The reason is that updates from executions are written into kvstore periodically, and the job start event may be missed. Manually run the job again and check the SQL Tab. The fix is pretty simple. Author: Gengliang Wang <[email protected]> Closes apache#20955 from gengliangwang/jobCompleted. (cherry picked from commit d8379e5) Signed-off-by: Marcelo Vanzin <[email protected]> Change-Id: I779e8d5363150afe3045c774f77f6395972192f8
What changes were proposed in this pull request?
A running SQL query would appear as completed in the Spark UI:

We can see the query in "Completed queries", while in in the job page we see it's still running Job 132.

After some time in the query still appears in "Completed queries" (while it's still running), but the "Duration" gets increased.

To reproduce, we can run a query with multiple jobs. E.g. Run TPCDS q6.
The reason is that updates from executions are written into kvstore periodically, and the job start event may be missed.
How was this patch tested?
Manually run the job again and check the SQL Tab. The fix is pretty simple.