FTP hangs on close

Oleg Broytmann phd at phd.russ.ru
Thu Mar 9 16:52:11 CET 2000


On 9 Mar 2000, Aahz Maruch wrote:
> >   On the other hand - it seems the program hangs hard - I cannot kill it
> >with ^C - only "kill $pid" can help. I cannot believe ftplib is waiting
> >"goodby" so hard :)
> Yes, it is, because it's not in Python, it's in a kernel socket call.
> I've run into this many times with urllib against HTTP.  Using a timeout

   Yes, I found that too. But I never saw an HTTP URL where my robot would
always hangs. It hangs sometimes on one URL, being run after few days it
would hangs on other URL...
   But there are some FTP URLs where my robot *always* hangs... :(
   (ftp://starship.python.net is one of these bad sites :)

> is the only answer.

   Sure I did this 3 years ago, when I encounter these hangs for the first
time. I rewrote my URL checker to fork, and parent watches the child and
kills it after 15 minutes.

> "Along the lines of getting a massage, taking a hot bubble bath, and
> swimming in a pool of warm, melted chocolate, can you give me some
> innovative ways that you pamper yourself?"
> "Spend three hours flaming stupid people on the Net."  --Aahz

   I hope it is not about me :)

    Oleg Broytmann      Foundation for Effective Policies      phd at phd.russ.ru
           Programmers don't die, they just GOSUB without RETURN.

More information about the Python-list mailing list