aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-07-25 21:37:06 +0200
committerLudovic Courtès <ludo@gnu.org>2017-07-25 23:24:15 +0200
commit236cae0628fd02002ec2c5e0405880908f244b56 (patch)
tree20044201b0c8cb5110e7557402659f948692b2e4
parentaf79852c99ef25f6d661c470f1d020e69ef34f1f (diff)
downloadpatches-236cae0628fd02002ec2c5e0405880908f244b56.tar
patches-236cae0628fd02002ec2c5e0405880908f244b56.tar.gz
offload: Disconnect sessions created by 'machine-load'.
This fixes a memory leak that can be seen by running: (map (lambda _ (machine-load m)) (iota 1000)) * guix/scripts/offload.scm (machine-load): Add call to 'disconnect!'.
-rw-r--r--guix/scripts/offload.scm1
1 files changed, 1 insertions, 0 deletions
diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm
index 566d117b02..868f54d1c6 100644
--- a/guix/scripts/offload.scm
+++ b/guix/scripts/offload.scm
@@ -400,6 +400,7 @@ allowed on MACHINE. Return +∞ if MACHINE is unreachable."
"cat" "/proc/loadavg"))
(line (read-line pipe)))
(close-port pipe)
+ (disconnect! session)
(if (eof-object? line)
+inf.0 ;MACHINE does not respond, so assume it is infinitely loaded