Currently there seems to be no way of telling that the remote vm is not
alive anymore. This patch implements counter that is re-set each time we
get data from the remote. If we don't receive any data in given time, we
fail gracefully. The problem is with sftp where we use paramiko methods
for putting/getting files to/from the remote and cannot use the counter
approach. Not to spend any more time on this, it'd be better to wait
until it is fixed in paramiko (issues are filed already) and watch logs
how often the remote becomes dead during sftp calls. This patch covers
the most time consuming case of talking to the remote which is the
actual task execution.
Note that the vm is not properly teared down which is subject of separate patch in D603.
Please add a link here to either our Phab ticket where we track this or a relevant upstream ticket.