I have discovered something a bit odd.
For a while, I've tried transferring files between different Apple computers I own. (Well, OK, technically, I don't own any Apple computers, my employer does.) I enabled remote login, and then would use sftp to transfer files.
This worked just fine for small files. For large files (let's say, measured in a few gigabytes), it was pretty much guaranteed that it would fail. The progress indicator at my end (so on the computer in front of me, the one I'm typing on) would inevitably say "stalled", and the throughput rate (also printed out in the progress line) would slowly decline until it reached zero. And then it would just say there.
I've now discovered that all I have to do is open up another terminal session on the local computer, and log into the remote computer using SSH. Then just type something, anything. List all the files in a directory, whatever. This seemed to magically reanimate the stalled sftp session, even if it had stopped quite a long time ago.
I'd say that's an OS bug - the computer must go into some state of partial shutdown, where not all functions are working all the time. It monitors ssh connections, to see if anyone remotely is trying to do something, but it doesn't do the same for sftp connections.
Time to complain to apple?