Help Center/ MapReduce Service/ Component Operation Guide (LTS) (Ankara Region)/ Using Spark/ Spark FAQ/ Why Is the RESTful Interface Information Obtained by Accessing Spark Incorrect?
Updated on 2024-11-29 GMT+08:00

Why Is the RESTful Interface Information Obtained by Accessing Spark Incorrect?

Question

After Spark stops, I access the RESTful interface of the application to obtain the job information. It is found that the value of numActiveTasks is a negative number.

Figure 1 Job information

numActiveTasks indicates the number of running tasks.

Answer

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

The value of numActiveTasks in the job information is calculated based on the difference between the number of SparkListenerTaskStart events and the number of SparkListenerTaskEnd events in the eventlog file. If any event in eventlog is lost, the problem may occur.