cylc/cylc — pull request #824 by benfitzpatrick (2013-12-18 19:14:41+00:00)
Title: cylc restart: fail for corrupt status in state dump

If a daemon host machine is killed abruptly, the state dump can be incomplete on a per-line basis and the "status=X, spawned=Y" information may be corrupted. This leads to the relevant task being skipped instead of a corrupted state dump failure as with other forms of state dump corruption. We had a problem where a task had a status of `waiti`!

This adds a check for that part of the state dump syntax and some tests.

P.S. There is still the more remote possibility that a state dump may be complete on a per-line basis by accident and not contain all the tasks... I think the only way to counteract this would be to either have a recorded number of task states (perhaps "Begin task states: 203" or something), or some kind of "End task states" line at the end.

@hjoliver, please review.

N.B. I *think* it's safe to have:
```python
raise x
```
where I've put:
```python
# TODO: Is it safe to have "raise x" here?
```
but I'm not sure - @hjoliver, could you advise? It can wait until after this pull request to be changed.