From b562b0fbc4b0169871db7f13516541e225a96735 Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 21 Nov 2016 03:10:41 +0000 Subject: [PATCH] artiq_devtool: detect a race condition during connect. --- artiq/frontend/artiq_devtool.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/artiq/frontend/artiq_devtool.py b/artiq/frontend/artiq_devtool.py index 7d4d71f5a..fc6f58048 100644 --- a/artiq/frontend/artiq_devtool.py +++ b/artiq/frontend/artiq_devtool.py @@ -116,6 +116,10 @@ def main(): local_stream, peer_addr = listener.accept() logger.info("Accepting %s:%s and opening SSH channel to %s:%s", *peer_addr, args.ip, port) + if get_ssh().get_transport() is None: + logger.error("Trying to open a channel before the transport is ready!") + continue + remote_stream = get_ssh().get_transport() \ .open_channel('direct-tcpip', (args.ip, port), peer_addr) while True: