diff mbox series

[bug#39873,3/3] substitute: Close port at the end of http-multiple-get.

Message ID 20200302210735.13337-3-mail@cbaines.net
State Accepted
Headers show
Series http-multiple-get enhancements | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Christopher Baines March 2, 2020, 9:07 p.m. UTC
* guix/scripts/substitute.scm (http-multiple-get): Add close-port call.
---
 guix/scripts/substitute.scm | 1 +
 1 file changed, 1 insertion(+)

Comments

Ludovic Courtès March 7, 2020, 9:14 p.m. UTC | #1
Christopher Baines <mail@cbaines.net> scribes:

> * guix/scripts/substitute.scm (http-multiple-get): Add close-port call.
> ---
>  guix/scripts/substitute.scm | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
> index a88cb5bcfe..e3f5837a8e 100755
> --- a/guix/scripts/substitute.scm
> +++ b/guix/scripts/substitute.scm
> @@ -544,6 +544,7 @@ initial connection on which HTTP requests are sent."
>            (()
>             (match (drop requests processed)
>               (()
> +              (close-port p)

LGTM!

Did you notice a file descriptor leak somewhere?

Thank you!

Ludo’.
Christopher Baines March 8, 2020, 11:58 p.m. UTC | #2
Ludovic Courtès <ludo@gnu.org> writes:

> Christopher Baines <mail@cbaines.net> scribes:
>
>> * guix/scripts/substitute.scm (http-multiple-get): Add close-port call.
>> ---
>>  guix/scripts/substitute.scm | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
>> index a88cb5bcfe..e3f5837a8e 100755
>> --- a/guix/scripts/substitute.scm
>> +++ b/guix/scripts/substitute.scm
>> @@ -544,6 +544,7 @@ initial connection on which HTTP requests are sent."
>>            (()
>>             (match (drop requests processed)
>>               (()
>> +              (close-port p)
>
> LGTM!
>
> Did you notice a file descriptor leak somewhere?

No, I was looking in to some wierd TLS related errors I had when using
http-multiple-get to query Curiass from the Guix Data Service, and I
noticed that maybe the port wasn't being closed when it should be.

I still haven't done a lot of testing, but I think some of these changes
have helped (although probably not this one).
diff mbox series

Patch

diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index a88cb5bcfe..e3f5837a8e 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -544,6 +544,7 @@  initial connection on which HTTP requests are sent."
           (()
            (match (drop requests processed)
              (()
+              (close-port p)
               (reverse result))
              (remainder
               (connect p remainder result))))