I think keeping our own version here is OK, in the sense that we remain conscious of adding new use of incompatible invocations.

I also suppose the exception handling is fine (I guess there are some 2.0-like distros that do not have the TaskAttemptContext.getCounter() method)...