[racket] host not found error

From: prad (prad at towardsfreedom.com)
Date: Sun May 6 16:41:10 EDT 2012

Danny Yoo <dyoo at cs.wpi.edu> writes:

> On Sunday, May 6, 2012, prad wrote:
>
>     i'm trying to understand a consistent error i'm getting while using a
>     racket program to get data from a website.
>    
>     i'm accessing the site to download certain posts using regexps and store
>     them in sqlite3.
>    
>     things go perfectly till i accumulate 336 records and then this error
>     crashes my script:
>
> Hi prad,
>
> Are you doing the open-input-url in a loop, out of curiosity?  If so, do you
> close the opened ports between each loop  iteration?
>
hi danny!
i using get-pure-port and yes it's in a loop.
i also delete-pure-port because i was getting a different error when i
didn't which was to run out of file-descriptors (i think) since i kept
getting a can't open database file error.

i found this:
https://bloggingmath.wordpress.com/2008/12/15/sqlite-unable-to-open-database-file/

but instead of increasing the limits, i deleted the port.


> 336 is a very specific observation.  Is it repeatable?
>
very - 4 times in a row so far.


>
>     tcp-connect: connection to www.30bananasaday.com, port 80 failed; host
>     not found (at step 1: Host name lookup failure; errno=2)
>    
>     so if it is a lookup failure that suggests the resolving server doesn't
>     like me after a certain number of lookups within a specific period of
>     time? is this reasoning correct?
>
> This particular error seems to be blaming host name lookup.  As far as I
> understand, the error's occuring even before you program can contact the
> remote server, if I understand the error message.  Odd.  If it were some kind
> of deliberate rate limiting, I'd expect a different class of error message.
>
i was thinking that since my resolving server was shawcable, may be they
put limits on.

i could try providing a ip, but i'm curious to see what is causing the error.


-- 
in friendship,
prad


Posted on the users mailing list.