[racket] Package server connection flaky?

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Tue Jan 13 14:42:12 EST 2015

On 2015-01-13 14:20:06 -0500, Asumu Takikawa wrote:
> Can we improve reliability of the package server for this use case or
> alternatively set up a meta-repo of all the main distribution packages
> (that can be checked out at once) to avoid this kind of thing?

BTW, maybe I spoke too soon. It looks like it's probably not the package
server's fault here and instead has to do with how tcp-connect does DNS
lookups. Or maybe there is something about my DNS setup that does not
interact well with tcp-connect.

When I run this snippet in the REPL:

  (for ([i 1000])
    (define-values (in out) (tcp-connect "pkgs.racket-lang.org" 80))
    (close-input-port in)
    (close-output-port out)
    (displayln i))

I get the same error behavior from doing the package update around
100-something iterations.

Meanwhile, this version:

  (define ip (dns-get-address "<my-dns-server>" "pkgs.racket-lang.org"))
  (for ([i 1000])
    (define-values (in out) (tcp-connect ip 80))
    (close-input-port in)
    (close-output-port out)
    (displayln i))

does not error. It also does not error when I move the `dns-get-address`
call into the loop.

Cheers,
Asumu

Posted on the users mailing list.