[PATCH 0/2] Small fixes for nstool
While working on the exeter tests, I noticed a couple of things missing in nstool. These make sense standalone, even if we don't have an urgent need for them without the exeter tests. David Gibson (2): test: Rename propagating signal handler test: Make nstool hold robust against interruptions to control clients test/nstool.c | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) -- 2.47.0
nstool in "exec" mode will propagate some signals (specifically SIGTERM) to
the process in the namespace it executes. The signal handler which
accomplishes this is called simply sig_handler(). However, it turns out
we're going to need some other signal handlers, so rename this to the more
specific sig_propagate().
Signed-off-by: David Gibson
Currently nstool die()s on essentially any error. In most cases that's
fine for our purposes. However, it's a problem when in "hold" mode and
getting an IO error on an accept()ed socket. This could just indicate that
the control client aborted prematurely, in which case we don't want to
kill of the namespace we're holding.
Adjust these to print an error, close() the control client socket and
carry on. In addition, we need to explicitly ignore SIGPIPE in order not
to be killed by an abruptly closed client connection.
Signed-off-by: David Gibson
On Wed, 6 Nov 2024 14:03:20 +1100
David Gibson
While working on the exeter tests, I noticed a couple of things missing in nstool. These make sense standalone, even if we don't have an urgent need for them without the exeter tests.
David Gibson (2): test: Rename propagating signal handler test: Make nstool hold robust against interruptions to control clients
Applied. Actually, one much-needed improvement for nstool in the current test framework (at least for my usage) would be to make it terminate when needed. A while ago, 'killall -9 nstool' entered my shell history and now it's right there with 'git rebase --continue': $ sort ~/.bash_history | uniq -c | sort -nr | grep -A1 'killall -9 nstool' 192 killall -9 nstool 192 git rebase --continue -- Stefano
On Thu, Nov 07, 2024 at 03:54:43PM +0100, Stefano Brivio wrote:
On Wed, 6 Nov 2024 14:03:20 +1100 David Gibson
wrote: While working on the exeter tests, I noticed a couple of things missing in nstool. These make sense standalone, even if we don't have an urgent need for them without the exeter tests.
David Gibson (2): test: Rename propagating signal handler test: Make nstool hold robust against interruptions to control clients
Applied.
Actually, one much-needed improvement for nstool in the current test framework (at least for my usage) would be to make it terminate when needed.
A while ago, 'killall -9 nstool' entered my shell history and now it's right there with 'git rebase --continue':
$ sort ~/.bash_history | uniq -c | sort -nr | grep -A1 'killall -9 nstool' 192 killall -9 nstool 192 git rebase --continue
Yeah, I have something similar. But, I don't currently know what exactly the circumstances are that lead to those stale nstools, so it would involve a fair bit of debugging. -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson
On Fri, 8 Nov 2024 10:30:00 +1100
David Gibson
On Thu, Nov 07, 2024 at 03:54:43PM +0100, Stefano Brivio wrote:
On Wed, 6 Nov 2024 14:03:20 +1100 David Gibson
wrote: While working on the exeter tests, I noticed a couple of things missing in nstool. These make sense standalone, even if we don't have an urgent need for them without the exeter tests.
David Gibson (2): test: Rename propagating signal handler test: Make nstool hold robust against interruptions to control clients
Applied.
Actually, one much-needed improvement for nstool in the current test framework (at least for my usage) would be to make it terminate when needed.
A while ago, 'killall -9 nstool' entered my shell history and now it's right there with 'git rebase --continue':
$ sort ~/.bash_history | uniq -c | sort -nr | grep -A1 'killall -9 nstool' 192 killall -9 nstool 192 git rebase --continue
Yeah, I have something similar. But, I don't currently know what exactly the circumstances are that lead to those stale nstools, so it would involve a fair bit of debugging.
Start tests, the ones using nstool (not the "ugly" ones), then ^C ^D until you're out of tmux, and nstool is _always_ there at that point. -- Stefano
On Fri, Nov 08, 2024 at 01:05:43AM +0100, Stefano Brivio wrote:
On Fri, 8 Nov 2024 10:30:00 +1100 David Gibson
wrote: On Thu, Nov 07, 2024 at 03:54:43PM +0100, Stefano Brivio wrote:
On Wed, 6 Nov 2024 14:03:20 +1100 David Gibson
wrote: While working on the exeter tests, I noticed a couple of things missing in nstool. These make sense standalone, even if we don't have an urgent need for them without the exeter tests.
David Gibson (2): test: Rename propagating signal handler test: Make nstool hold robust against interruptions to control clients
Applied.
Actually, one much-needed improvement for nstool in the current test framework (at least for my usage) would be to make it terminate when needed.
A while ago, 'killall -9 nstool' entered my shell history and now it's right there with 'git rebase --continue':
$ sort ~/.bash_history | uniq -c | sort -nr | grep -A1 'killall -9 nstool' 192 killall -9 nstool 192 git rebase --continue
Yeah, I have something similar. But, I don't currently know what exactly the circumstances are that lead to those stale nstools, so it would involve a fair bit of debugging.
Start tests, the ones using nstool (not the "ugly" ones), then ^C ^D until you're out of tmux, and nstool is _always_ there at that point.
Huh. I usually exit with ^B-& then ^C and that only occasionally leaves things behind. -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson
participants (2)
-
David Gibson
-
Stefano Brivio