Description
A task encountered an internal error due to "Invalid event: T_ATTEMPT_FAILED at FAILED". The task had two outstanding attempts, as one was speculative. The main attempt failed causing the task to fail, and when the speculative attempt subsequently failed the T_ATTEMPT_FAILED triggered the invalid state transition.
It appears there needs to be some hardening of the TaskImpl state machine in light of speculative attempt events arriving late. Besides this scenario I think there may be others, e.g.: speculative attempt succeeding just as overall task fails appears to be unhandled.