unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Andy Patterson <ajpatter@uwaterloo.ca>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] scripts: substitute: Avoid infinite looping when updating the substitute list
Date: Tue, 07 Jul 2015 01:08:28 +0200	[thread overview]
Message-ID: <873810q3yr.fsf@gnu.org> (raw)
In-Reply-To: <5599C9F2.4080207@uwaterloo.ca> (Andy Patterson's message of "Sun, 5 Jul 2015 20:21:06 -0400")

Hi,

Andy Patterson <ajpatter@uwaterloo.ca> skribis:

> I was having trouble using substitutes, so I decided to investigate it.
> I found out that when retrieving the batch of .narinfo files from the
> server, my connection was always being closed after the first response.
> Therefore, I would always be reconnecting to the server with every
> request in the batch still to process, and this reconnecting would be
> repeated infinitely, or at least until my Internet went down. Based on
> the documentation for the "connection: close" header, I think that this
> first response should be complete, so we can use it. Maybe I'm wrong;
> I'm not totally familiar with how http works.

Indeed, <https://tools.ietf.org/html/rfc7230#section-6.1> reads:

  The "close" connection option is defined for a sender to signal that
  this connection will be closed after completion of the response.

> This patch will make use of the last response from the server, before
> reconnecting to try the next one. With it I was able to successfully
> build and run links.
>
> Let me know if my understanding is off, or if there's a better approach.

I think you found a genuine bug and provided the right patch!

Did you observe the problem when connecting to hydra.gnu.org, or was it
another server?  Did you have a way to reproduce it?

(In my experience Nginx at hydra.gnu.org closes the connection after
~100 responses, so even if the last response is not consumed directly,
that’s OK.)

> From 633c491e2dad4c3a70eb045177c17bd2552d63f3 Mon Sep 17 00:00:00 2001
> From: Andy Patterson <ajpatter@uwaterloo.ca>
> Date: Sun, 5 Jul 2015 19:34:05 -0400
> Subject: [PATCH] scripts: substitute: Avoid infinite looping when updating the
>  substitute list
>
> * guix/scripts/substitute.scm (http-multiple-get): Make use of the current
>   response before reconnecting.

I’ve committed a slightly edited version of the patch where I factorized
the call to PROC and changed the commit message to describe the changes
at the source code level, in GNU change log style.  (I hope this is fine
with you.)

Thank you!

Ludo’.

  reply	other threads:[~2015-07-06 23:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06  0:21 [PATCH] scripts: substitute: Avoid infinite looping when updating the substitute list Andy Patterson
2015-07-06 23:08 ` Ludovic Courtès [this message]
2015-07-07  0:08   ` Andy Patterson
2015-07-07 14:52     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873810q3yr.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=ajpatter@uwaterloo.ca \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).