From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org,
"John Warthog9 Hawley" <warthog9@kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [for-linus][PATCH 0/3] ktest.pl: Fix ssh hanging and reseting of console
Date: Fri, 20 Jan 2023 18:10:59 +0900 [thread overview]
Message-ID: <20230120181059.98a4094eb4267b77f156bc39@kernel.org> (raw)
In-Reply-To: <20230118215435.016435760@goodmis.org>
On Wed, 18 Jan 2023 16:54:35 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:
> I've noticed that my ssh sessions would hang during test runs, which
> is really frustrating when you kick off a 13 hour test before going to
> bed, and the second test (1 hour into it) hangs, and you need to kick
> it off again in the morning (wasting all that time over night).
>
> I finally figured out the cause. There is a disconnect between
> the run_command that executes the test, and the "wait_for_input" that
> monitors the test. The wait_for_input has a default of 2 minute timeout
> if it doesn't see any output it returns. The run_command takes the
> empty string from wait_for_input as the test is finished, and then
> stops monitoring it, and calls waitpid() waiting for the test to
> exit.
>
> The problem is that if the test has a lot of output, it will continue
> writing into the pipe that was suppose to go to the monitor, which has
> now exited the loop. When the pipe fills up, it will not finish.
> When the test is over, it just hangs waiting for the pipe to flush
> (which never happens).
>
> To fix this, change the run_command to by default have an infinite
> run (which can be overridden by the new RUN_TIMEOUT option), and
> make the wait_for_input also wait indefinitely in this case. It now
> Now the tests will have its content continuously read and will exit
> normally.
>
> While debugging this, I also found out why you can lose stdout on
> the terminal sometimes. Especially if you hit Ctrl^C while the monitor
> is running. It was due to missing "end_monitor" which gives back the
> tty to the terminal. The first two patches fix that.
>
>
Thanks for updating. I ran the test and confirmed that the terminal
setting is recovered :)
Tested-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
BTW, I found another issue that if I didn't set up sendmail,
it doesn't recover stty. Let me send a fix.
>
> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git
> devel
Also, this devel branch seems not pushed yet.
Thank you,
>
> Head SHA1: aa9aba9382884554fe6a303744884866d137422d
>
>
> Steven Rostedt (3):
> ktest.pl: Fix missing "end_monitor" when machine check fails
> ktest.pl: Give back console on Ctrt^C on monitor
> ktest.pl: Add RUN_TIMEOUT option with default unlimited
>
> ----
> tools/testing/ktest/ktest.pl | 26 +++++++++++++++++++++-----
> tools/testing/ktest/sample.conf | 5 +++++
> 2 files changed, 26 insertions(+), 5 deletions(-)
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
prev parent reply other threads:[~2023-01-20 9:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 21:54 Steven Rostedt
2023-01-18 21:54 ` [for-linus][PATCH 1/3] ktest.pl: Fix missing "end_monitor" when machine check fails Steven Rostedt
2023-01-18 21:54 ` [for-linus][PATCH 2/3] ktest.pl: Give back console on Ctrt^C on monitor Steven Rostedt
2023-01-18 21:54 ` [for-linus][PATCH 3/3] ktest.pl: Add RUN_TIMEOUT option with default unlimited Steven Rostedt
2023-01-20 9:10 ` Masami Hiramatsu [this message]
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=20230120181059.98a4094eb4267b77f156bc39@kernel.org \
--to=mhiramat@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=warthog9@kernel.org \
/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
Powered by JetHome