[YARN][SPARK-2606]:In some cases,the spark UI pages display incorrect

The issue is caused by #1112 .