From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EE8AA45DD5; Thu, 12 Dec 2024 20:39:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 757994026B; Thu, 12 Dec 2024 20:39:15 +0100 (CET) Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) by mails.dpdk.org (Postfix) with ESMTP id 3210E40269 for ; Thu, 12 Dec 2024 20:39:14 +0100 (CET) Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-6d887b54921so1435306d6.2 for ; Thu, 12 Dec 2024 11:39:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1734032353; x=1734637153; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2+eEYULQdQpI22FetqEPU5mrBO9+dRiiUIYhpQ492dI=; b=bK2YkNdid1n127NQB3/Nw8HtCcSiXFbYntOTEb7u/zvtlTzK/XnW8T32f0mxBCumzy ZrBEmz7OiXATj/Rc5VEg6cYUkGK57xkWPaxeB+yFsEEE96BB86wO5Bgq7romc+Vfh0HP AgTdm+ZlV0/Nr3KQ9hHnfXWk2J+cmN8Exmf1E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734032353; x=1734637153; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2+eEYULQdQpI22FetqEPU5mrBO9+dRiiUIYhpQ492dI=; b=Fj1xvmP0hRZ6TN6hKbuB6dWWYuZGEwaH6LF4wi9p3T5JV5WCczDFUs3XYXS5e8wySw IztyyhFGiNgnYe8I7Vk1f6pUlGmPNJRz80ZZ+q1SCeSr3gpZtfktxu16xd86HVrfd+iz kuUzw+yRp2TqdltC5sHhmza3FRihGeMc8wXr0pirWT2AF/aKSGjfQkqDIpQ+eizbL70a aaBkSznBt67a3uhvu5zEJVzPucVk8K8qa1Zhge0S63Ut/0TNEHIHONPS6uyt/Wztxo/8 DC3My3kkQDA4hv5pPNP63865Ic5M60QvTw3t+0XtC84cIsJ3r4RUz432GFvxvHvfvrZL bR2w== X-Gm-Message-State: AOJu0Yz0sHyNUO7efEz3q6Eyo2+yytU9rjDXNx+O5qNmPmGGMeLFtt2Z fJX/eQQ/OzpK/ho9eDF8NyfIp0qhwiQK2xyI1jHs7hUT+Gev4yrbkitmAHoTOGQ= X-Gm-Gg: ASbGncvmnLYTD2d8OLyNj7Sr8yrg+82XarQIgN3u5gVwgJBPTZ1bNs2YIQQzK1eVhDg 37//VD1YVZY5tyjvrfeBwcu/Tt8rxdp79hhZDuJ3OWwAiE1Sz+ErsJyEK+wmSpnWxoFLdqKkGqJ AGFgM2zQigoItwnTLwC3CrRkEttvBmQ2wlRnRRZScIyIvRW+kVV4w3Dr/z597vCQxsZCAb6Tvs4 3EpLkTl+xX9++p1WVzD8skL3//rdjZZ01y0SJCMd9ZHsbAEy+wgnZsxmLAO4Pu0RqJlIlyjzhUr +8Sybw9IyQ== X-Google-Smtp-Source: AGHT+IEycPkeAw9ifgzcnGwNtriugToxgQcWeLtHy8habdyv4g6WuT6JTS9BiF+3BXk61X7kYvVOvA== X-Received: by 2002:a05:6214:d48:b0:6d8:967a:1a60 with SMTP id 6a1803df08f44-6db0f706a46mr8595586d6.2.1734032353471; Thu, 12 Dec 2024 11:39:13 -0800 (PST) Received: from localhost.unh.edu ([2606:4100:3880:1271:e2f8:4ec3:8bf3:864c]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d8f81f10b0sm62849776d6.101.2024.12.12.11.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 11:39:12 -0800 (PST) From: Nicholas Pratte To: probb@iol.unh.edu, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, thomas.wilks@arm.com, yoan.picchi@foss.arm.com, luca.vizzarro@arm.com, dmarx@iol.unh.edu Cc: dev@dpdk.org, Nicholas Pratte Subject: [PATCH v1] dts: bug fixes for paramiko timeout and buffered_pipe issues Date: Thu, 12 Dec 2024 14:39:02 -0500 Message-ID: <20241212193902.31789-1-npratte@iol.unh.edu> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org There exists some inconsistencies in the successful initialization of interactive applications within remote sessions. On some testbeds, there is a consistent failure in the first start-up attempt of an application, and 'stdin' and 'stdout' buffered pipes also indicate improper deallocation. The issue stems from a remote server's inability to fully exit out of an interactive application before the complete clean up of the SingleInteractiveShell context manager. Moreover, the experience of buffered pipe or related exceptions as a result of 'stdin' and 'stdout' buffered pipes is a result of the context manager's cleanup process. Explicit calls to close the 'stdin' buffered pipe is needless and this is done via a 'Channel.close()' within Paramiko. The following patch corrects these issues. Bugzilla ID: 1597 Signed-off-by: Nicholas Pratte --- .../remote_session/single_active_interactive_shell.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dts/framework/remote_session/single_active_interactive_shell.py b/dts/framework/remote_session/single_active_interactive_shell.py index e3f6424e97..90ba862dbb 100644 --- a/dts/framework/remote_session/single_active_interactive_shell.py +++ b/dts/framework/remote_session/single_active_interactive_shell.py @@ -231,7 +231,13 @@ def send_command( return out def _close(self) -> None: - self._stdin.close() + try: + # Ensure the primary application has terminated via readiness of 'stdout'. + self._ssh_channel.recv(1) # 'Waits' for a single byte to enter 'stdout' buffer. + except TimeoutError as e: + self._logger.exception(e) + self._logger.debug("Application failed to exit before set timeout.") + raise InteractiveSSHTimeoutError("Application 'exit' command") from e self._ssh_channel.close() def _update_real_path(self, path: PurePath) -> None: -- 2.44.0