﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	launchpad_bug
1525	SFTP: handle download failures correctly; remove use of IFinishableConsumer	davidsarah	warner	"Brian noticed that a Deferred was being dropped at [source:src/allmydata/frontends/sftpd.py@5179#L676]. (Although this code changed when MDMF landed [changeset:a87fc8ffab55dfd2], the immutable path of the [source:src/allmydata/frontends/sftpd.py@5127#L675 previous code] also dropped a Deferred, at line 680.)

It is incorrect to drop the Deferred, because that will cause SFTP read requests to hang if downloading the previous file contents fails. However fixing it while still allowing streaming reads is a bit tricky. The intention is that we download the file in parallel with accepting SFTP requests, and block each read request until the relevant part of the file is available (and prior writes have completed). If the download fails, then any SFTP read requests past the prefix that was read correctly should also fail. Also, if the file was written and not truncated, the SFTP close request should fail, at least in the case when the new contents depend on the part of the old contents that we weren't able to download."	defect	closed	critical	1.10.0	code-frontend	1.9.0a1	fixed	sftp hang error streaming performance blocker		
