Help Center/ MapReduce Service/ Troubleshooting/ Using Spark/ Why Does the Spark RESTful API Return Incorrect Application Information?
Updated on 2026-10-21 GMT+08:00

Why Does the Spark RESTful API Return Incorrect Application Information?

Symptom

After a Spark application stops, accessing its REST API to retrieve job information may show a negative value for numActiveTasks, as shown in Figure 1.

Figure 1 Job information

numActiveTasks indicates the number of currently running tasks.

Procedure

Obtain job information in either of the following ways:
  • Set spark.history.briefInfo.gather to true and view brief information about JobHistory.
  • Access the Spark JobHistory2x page at https://IP:port/api/v1/<appid>/jobs/.

The value of numActiveTasks in the job information is calculated by finding the difference between the number of SparkListenerTaskStart events and SparkListenerTaskEnd events in the eventlog file. If any of these events are lost from the eventLog file, this issue will occur.