Description
Currently, TaskImpl doesn't consider failing a task if there are too many overall attempts. In case of LLAP, the number of preempted task attempts -> overall task attempts can grow in a linkedhashmap.
In an edge case, where an upstream application (Hive LLAP) cannot cope with a problematic query, this can also lead to OOM in the AM, due the very high number of TaskAttemptImpl objects.
It would be beneficial to have the chance to limit the overall number of task attempts, regardless of they have been failed or killed.