summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2018-03-05 05:11:45 +0300
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2018-03-05 05:11:45 +0300
commite24401f1ef56b1f3d7ef847c54fb0c2fe9cf3cf8 (patch)
tree13fb921319587dad3fdae30a94b69c1a94e8d3ee
parentauth.scm: Add procedures for interacting w/ an OpenSSH agent (diff)
downloadguile-ssh-e24401f1ef56b1f3d7ef847c54fb0c2fe9cf3cf8.tar.gz
node.scm (node-run-server): Check return code
* modules/ssh/dist/node.scm (node-run-server): Check return code of the executed command, throw a 'node-error' on a non-zero code. * AUTHORS, NEWS, THANKS: Update.
-rw-r--r--AUTHORS4
-rw-r--r--NEWS10
-rw-r--r--THANKS1
-rw-r--r--modules/ssh/dist/node.scm15
4 files changed, 23 insertions, 7 deletions
diff --git a/AUTHORS b/AUTHORS
index 4fd0357..bc8fe0b 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -55,4 +55,6 @@ See also files THANKS and ChangeLog.
Bug reports, various comments and suggestions.
* Mathieu <https://github.com/mothacehe>
- Pointed out to bugs in 'rrepl-get-result' from (ssh dist node). \ No newline at end of file
+ Pointed out to bugs in 'rrepl-get-result' from (ssh dist node).
+* Marius Bakke <mbakke@fastmail.com>
+ Pointed out to buigs in 'node-run-server' from (ssh dist node). \ No newline at end of file
diff --git a/NEWS b/NEWS
index ddbfa35..3c246e4 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,16 @@ Copyright (C) Artyom V. Poptsov <poptsov.artyom@gmail.com>
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
+* Unreleased
+** Bugfixes
+*** 'node-run-server' now checks for errors
+ When 'node-run-server' fails to start the server it would go down an
+ infinite loop. The procedure now checks if the RREPL server started
+ correctly and throws 'node-error' if it's not.
+
+ Reported by Marius Bakke and Ludovic Courtès, in
+ <https://bugs.gnu.org/30522>
+
* Changes in version 0.11.2 (2017-06-18)
** Bugfixes
*** Always reset the channel and sftp streams when closing ports
diff --git a/THANKS b/THANKS
index 4cbf399..4e5878b 100644
--- a/THANKS
+++ b/THANKS
@@ -13,6 +13,7 @@ through bug reports or patches:
* Ludovic Courtès <ludo@gnu.org>
* SaffronSnail <https://github.com/SaffronSnail>
* Mathieu <https://github.com/mothacehe>
+* Marius Bakke <mbakke@fastmail.com>
Thank you. \ No newline at end of file
diff --git a/modules/ssh/dist/node.scm b/modules/ssh/dist/node.scm
index 09ce794..9ff3750 100644
--- a/modules/ssh/dist/node.scm
+++ b/modules/ssh/dist/node.scm
@@ -349,13 +349,16 @@ listens on an expected port, return #f otherwise."
(guile-up-and-running?))))))))
+(define %guile-listen-command "nohup guile --listen=~a 0<&- &>/dev/null")
+
(define (node-run-server node)
- "Run a RREPL server on a NODE."
- (open-remote-input-pipe (node-session node)
- (format #f "nohup guile --listen=~a 0<&- &>/dev/null"
- (node-repl-port node)))
- (while (not (node-server-running? node))
- (usleep 100)))
+ "Run a RREPL server on a NODE. Throw 'node-error on an error."
+ (let* ((cmd (format #f %guile-listen-command (node-repl-port node)))
+ (channel (open-remote-input-pipe (node-session node) cmd)))
+ (when (not (zero? (channel-get-exit-status channel)))
+ (node-error "node-run-server: Could not execute command" cmd))
+ (while (not (node-server-running? node))
+ (usleep 100))))
(define (node-stop-server node)
"Stop a RREPL server on a NODE."