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!'.
This commit is contained in:
Ludovic Courtès 2017-07-25 21:37:06 +02:00
parent af79852c99
commit 236cae0628
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -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