private void updateTask(final ShardedJobStateImpl<T> jobState,
final IncrementalTaskState<T> taskState, /* Nullable */
final ShardRetryState<T> shardRetryState, boolean aggresiveRetry) {
taskState.setSequenceNumber(taskState.getSequenceNumber() + 1);
taskState.getLockInfo().unlock();
ExceptionHandler exceptionHandler =
aggresiveRetry ? AGGRESIVE_EXCEPTION_HANDLER : EXCEPTION_HANDLER;
RetryHelper.runWithRetries(callable(new Runnable() {
@Override
public void run() {
Transaction tx = DATASTORE.beginTransaction();