Store task state even if task has failed (#2383) Previously when a failing task created new files, those files would be recognized as overlapping outputs from some unknown source. Overlapping outputs would then cause task output caching to be disabled for the task.
We now persist the task's state even after a failed execution. But in the failure case we only persist the snapshots if there was a change to the outputs. When we do this, we also record that the execution failed. However, if the failing task didn't change its outputs, there is no need to persist its state. This will allow the task to run in incremental mode the next time it's executed.
For tasks that do modify their outputs incremental execution was always disabled the next time they were executed, and this change preserves that behavior.