apache/spark — pull request #1896 by JoshRosen (2014-08-11 21:04:53+00:00)
Title: [SPARK-2931] In TaskSetManager, reset currentLocalityIndex after recomputing locality levels

This addresses SPARK-2931, a bug where getAllowedLocalityLevel() could throw ArrayIndexOutOfBoundsException. The fix here is to reset currentLocalityIndex after recomputing the locality levels.

Thanks to @kayousterhout, @mridulm, and @lirui-intel for helping me to debug this.