[ftputil] Timeout connection but transferring data
Antonio Beamud Montero
antonio.beamud@linkend.com
Tue, 09 Mar 2004 08:26:49 -0000
Hi all:
I have an strange problem. I have make an python script that connects
with a pure-ftpd in solaris and upload a lot of files automatically. The
problem occurs when 1800 seconds pass. In that moment an exception
occurs with:
421 Timeout (no operation for 1800 seconds).
This timeout occurs in the middle of an upload, when I have upload tons
of files...
Really is not a problem, because this script is executed lately by cron
and is smart to upload again all the files not upload correctly, but I
don't know why this happens...
The script is exectued in machine A to transfer files from machine B to
machine C, (Stefan, I work in mode file-like objects)...
I exposed this problem to Stefan and he reply me the next message (A lot
of thanks Stefan):
---------------------------------------------------
Hi Antonio:
On Mon, 2004-03-08 16:58:43 +0100, Antonio Beamud Montero wrote:
> I have an strange problem. I have make an python script that connects
with a
> pure-ftpd in solaris and upload a lot of files automatically. The
problem
> occurs when 1800 seconds pass. In that moment an exception occurs
with:
> 421 Timeout (no operation for 1800 seconds).
>
> I can't open a connection for such time...?
Most FTP servers are configured so that they close the connection when
there is no traffic. For most servers I've seen, that time interval is
about ten minutes. It's most probably not a client issue that the
connection is lost.
On the other hand, _if_ you are actually transferring data all the time,
the timeout surprises me indeed (maybe I misunderstood you here). In
that case I'd recommend to talk to the server's administrators.
> I need to relogin every file...?
I think not, see below.
Currently, ftputil supports no automatic re-login after timeouts. If a
timeout occured while a file-like object is open, I wouldn't even know
a way to re-establish that state. However, it might be possible to
reconnect on timeouts transparently if you are working in a mode where
you think in files, directories etc., not file-like objects. Hm, I'll
think about that and will put something on that on my todo list.
That said, you are still _not_ out of luck. :-) Can't you resume the
connection yourself if a timeout happens? Or, _if_ you know, you are
much more waiting than transferring, it might be feasible, to open and
close the connection before and after every transfer, respectively.
I guess it would help a lot if you described the things you are doing
in more detail. I think, then we can come up with a solution or a
workaround. :-)
By the way, it might help others later to discuss this issue on the
mailing list, ftputil@codespeak.net . In that case please send your
original question and my reply to the list so the mails get into the
archives. Note that you can post to the list without being subscribed
to the list! :-)
Stefan
--
Antonio Beamud Montero <antonio.beamud@linkend.com>