[ 
https://issues.apache.org/jira/browse/SPARK-41683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17651498#comment-17651498
 ] 

Apache Spark commented on SPARK-41683:
--------------------------------------

User 'kuwii' has created a pull request for this issue:
https://github.com/apache/spark/pull/39190

> Spark UI: In jobs API, numActiveStages can be negative in some cases
> --------------------------------------------------------------------
>
>                 Key: SPARK-41683
>                 URL: https://issues.apache.org/jira/browse/SPARK-41683
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core, Web UI
>    Affects Versions: 3.3.1
>            Reporter: wy
>            Priority: Minor
>         Attachments: image-2022-12-22-16-06-21-180.png, 
> image-2022-12-22-16-06-45-367.png, image-2022-12-23-13-24-30-412.png
>
>
> In API /api/v1/applications/.../jobs, for each job, there's one property 
> called numActiveStages, telling how many active stages of the job.
> It is calculated by the following logic:
>  * When stage is submitted, numActiveStages += 1.
>  * When stage is completed, numActiveStages -= 1.
>  * When job is ended, for each pending stage, numActiveStages -= 1.
> !image-2022-12-22-16-06-45-367.png!
> !image-2022-12-23-13-24-30-412.png!
> !image-2022-12-22-16-06-21-180.png!
>  
> However, there's possibility that there's no stage submitted event for some 
> skipped stages. In this case, when job ends, numActiveStages may be minus. 
> Example:
>  # job 0 started with stage 0, 1, 2
>  ** stage 0: pending
>  ** stage 1: pending
>  ** stage 2: pending
>  ** numActiveStages: 0
>  # stage 0 submitted
>  ** stage 0: active
>  ** stage 1: pending
>  ** stage 2: pending
>  ** numActiveStages: 1
>  # stage 0 completed
>  ** stage 0: completed
>  ** stage 1: pending
>  ** stage 2: pending
>  ** numActiveStages: 0
>  # job 0 ended
>  ** stage 0: completed
>  ** stage 1: skipped
>  ** stage 2: skipped
>  ** numActiveStages: -2



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to