connection closed after 60seconds behind AWS ELB
|Reported by:||francois.legillon||Owned by:|
|Component version:||Operating system type:||Linux|
|Operating system version:|
I have a ftp server (vsftpd) on a Amazon Web Services EC2 virtual machine in a production environment.
It's behind a Load Balancer, I access it using filezilla in passive mode for datas (vsftpd is configured to give the direct ip instead of using the load balancer for datas).
Data and control channel thus have different ips.
I use classic ftp (no ssl or whatever).
After exactly 60 seconds of transfer (upload or download, juste big enough to last more than 60seconds) i get a "server closed connection" error, for any version of filezilla (>=3)
that didnt segfault i tried.
But VSFTPD never actually closed the connection...
I looked into filezilla source code, the problem seems to come around in src/engine/ftpcontrolsocket.cpp.
There is a control that seems to provoke the bug in CFtpControlSocket::OnReceive...
By commenting it the problem disappear
LogMessage(::Error, _("Connection closed by server"));
DoClose(); <= there i commented
the transfers stall a few seconds in the end of the transfer (it might be this test purpose) but i dont lose my connexion and the file transfered is ok.
Without the ELB (using the same ip for control and data) i dont get the initial problem.
I dont think this a good fix, but it does fix the problem for me.