When a task is speculating and one attempt completes then sometimes the counters for the wrong attempt are aggregated into the total counters for the job. The scenario looks like this:
- Two task attempts are racing, _0 and _1
- _1 finishes first, causing the task to issue a TA_KILL to attempt _0
- _0 receives TA_KILL, sets progress to 1.0f and waits for container cleanup
- if TaskImpl.getCounters() is called now, TaskImpl.selectBestAttempt() can return _0 since it is not quite yet in the KILLED state yet progress is maxed out and no other attempt has more progress.