Open johnstruse opened 7 years ago
Sorry for the big delay in responding. Was there any progress about this? You can try running the server with DEBUG logging enabled:
from pyftpdlib.log import config_logging
config_logging(level=logging.DEBUG)
Hopefully that may give some hints about what syscall the busy loop keeps calling. It should be either send() or recv() failing with a certain error code.
Hi there, I've got a similar (maybe the same) issue here. DEBUG logging led me to TLS implementation error. So far I've disabled TLS_FTPHandler and I'm using only FTPHandler. This fixed this loop Also noticed that the bug/error is reproducible when editing a file between a ~60 sec interval.
This is the log when the issue occurs: (fake user and IP for privacy)
DEBUG:pyftpdlib:refreshing tasks (2 join() potentials) DEBUG:pyftpdlib:[debug] call: recv(), err: SysCallError(-1, 'Unexpected EOF') (<LWFTPHandler(id=139969512712568, addr='1.2.3.4:57286', ssl=True, user='user123')>) DEBUG:pyftpdlib:[debug] call: _do_ssl_shutdown() -> shutdown(), err: Error([('SSL routines', '', 'shutdown while in init')],) (<LWFTPHandler(id=139969512712568, addr='1.2.3.4:57286', ssl=True, user='user123')>)
I had the same issue and it's apparently related to multiple inheritance of TLS_FTPHandler from both SSLConnection and FTPHandler. During calls to the close() method, only SSLConnection.close() is executed, the missing call to FTPHandler.close() then causes the issue.
See pull request #613
We have been scanning our FTP servers with Nessus and frequently after a batch of scans have been run, the FTP server will be using 100% on Linux. An strace reveals that it is very rapidly attempting to poll one or more sockets (depending on how many are stuck).
In the FTPD logs, all other connections by
yyy.yyy.yyy.yyy
show that they were opened and closed successfully, however port38968
shows an opened connection and then a timeout, but the socket never closed.On
yyy.yyy.yyy.yyy
, a quicknetstat
shows that the socket is not open on that end any longer.