DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nicholas Pratte <npratte@iol.unh.edu>
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 <npratte@iol.unh.edu>
Subject: [PATCH v1] dts: bug fixes for paramiko timeout and buffered_pipe issues
Date: Thu, 12 Dec 2024 14:39:02 -0500	[thread overview]
Message-ID: <20241212193902.31789-1-npratte@iol.unh.edu> (raw)

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 <npratte@iol.unh.edu>
---
 .../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


             reply	other threads:[~2024-12-12 19:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12 19:39 Nicholas Pratte [this message]
2025-01-24 14:30 ` Paul Szczepanek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241212193902.31789-1-npratte@iol.unh.edu \
    --to=npratte@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=dmarx@iol.unh.edu \
    --cc=luca.vizzarro@arm.com \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=thomas.wilks@arm.com \
    --cc=yoan.picchi@foss.arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).