* [PATCH v1] dts: bug fixes for paramiko timeout and buffered_pipe issues
@ 2024-12-12 19:39 Nicholas Pratte
2025-01-24 14:30 ` Paul Szczepanek
0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Pratte @ 2024-12-12 19:39 UTC (permalink / raw)
To: probb, Honnappa.Nagarahalli, paul.szczepanek, thomas.wilks,
yoan.picchi, luca.vizzarro, dmarx
Cc: dev, Nicholas Pratte
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v1] dts: bug fixes for paramiko timeout and buffered_pipe issues
2024-12-12 19:39 [PATCH v1] dts: bug fixes for paramiko timeout and buffered_pipe issues Nicholas Pratte
@ 2025-01-24 14:30 ` Paul Szczepanek
0 siblings, 0 replies; 2+ messages in thread
From: Paul Szczepanek @ 2025-01-24 14:30 UTC (permalink / raw)
To: Nicholas Pratte, probb, Honnappa.Nagarahalli, thomas.wilks,
yoan.picchi, luca.vizzarro, dmarx
Cc: nd, dev
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-24 14:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-12 19:39 [PATCH v1] dts: bug fixes for paramiko timeout and buffered_pipe issues Nicholas Pratte
2025-01-24 14:30 ` Paul Szczepanek
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).