| 21 Oct 2021 |
baloo | Not entirely sure I read the test driver correctly but, we’re just sending it a sigterm right? | 19:30:44 |
baloo | one option would be to just SIGKILL, which should work and is just fine. (we don't care about the consistency of any open file, they are either readonly or about to be deleted) | 19:32:07 |
K900 | Yes | 19:32:08 |
K900 | I find it weird that it seems to lock up when sigterm'd | 19:32:29 |
K900 | On one hand, we don't care, and it's probably qemu's fault | 19:32:36 |
K900 | On the other hand, it really shouldn't do that | 19:32:40 |
baloo | one other is to ask qemu to quit like:
echo "quit" | socat STDIO UNIX-CONNECT:./console.pipe
with qemu started like:
-mon chardev=con0,mode=readline \
-chardev socket,id=con0,path=./console.pipe,server,nowait \
| 19:32:59 |
K900 | There's already a socket for that | 19:33:18 |
K900 | It's what all the commands run through | 19:33:23 |
baloo | the socket the commands run through is the serial console of the inner vm | 19:33:49 |
baloo | this is the monitor socket of qemu itself | 19:33:58 |
K900 | There's a second socket for the monitor too | 19:34:02 |
baloo | diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py
index e659b0c04f5..1518bf3562a 100755
--- a/nixos/lib/test-driver/test-driver.py
+++ b/nixos/lib/test-driver/test-driver.py
@@ -1021,6 +1021,7 @@ class Machine:
assert self.process
assert self.shell
assert self.monitor
+ self.send_monitor_command("quit")
self.process.terminate()
self.shell.close()
self.monitor.close()
I'd give this a try
| 19:36:41 |
Janne Heß | I'll do that | 19:36:57 |
K900 | https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/test-driver/test-driver.py#L957 | 19:37:14 |
K900 | That's weird | 19:37:16 |
K900 | Also that whole thing should probably use the JSON protocol... | 19:37:33 |
Janne Heß | In reply to @baloo_:matrix.org
diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py
index e659b0c04f5..1518bf3562a 100755
--- a/nixos/lib/test-driver/test-driver.py
+++ b/nixos/lib/test-driver/test-driver.py
@@ -1021,6 +1021,7 @@ class Machine:
assert self.process
assert self.shell
assert self.monitor
+ self.send_monitor_command("quit")
self.process.terminate()
self.shell.close()
self.monitor.close()
I'd give this a try
Still hangs at the end | 19:39:26 |
K900 | Can you get a traceback? | 19:41:19 |
Janne Heß | in python? | 19:41:28 |
Janne Heß | py-spy should be enough? | 19:41:34 |
K900 | Yeah | 19:41:56 |
Janne Heß | oh lol it failed more horribly now | 19:43:00 |
Janne Heß | clean up
kill machine (pid 9)
machine: sending monitor command: quit
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/nix/store/97w52ckcjnfiz89h3lh7zf1kysgfm2s8-python3-3.9.6/lib/python3.9/contextlib.py", line 135, in __exit__
self.gen.throw(type, value, traceback)
File "/nix/store/7v40kpl69d7ydhm2mz7wkl8q04yc8xly-nixos-test-driver/bin/.nixos-test-driver-wrapped", line 172, in nested
yield
File "/nix/store/7v40kpl69d7ydhm2mz7wkl8q04yc8xly-nixos-test-driver/bin/.nixos-test-driver-wrapped", line 1139, in clean_up
machine.release()
File "/nix/store/7v40kpl69d7ydhm2mz7wkl8q04yc8xly-nixos-test-driver/bin/.nixos-test-driver-wrapped", line 1039, in release
self.send_monitor_command("quit")
File "/nix/store/7v40kpl69d7ydhm2mz7wkl8q04yc8xly-nixos-test-driver/bin/.nixos-test-driver-wrapped", line 509, in send_monitor_command
self.monitor.send(message)
BrokenPipeError: [Errno 32] Broken pipe
| 19:43:11 |
K900 | Huh | 19:43:21 |
K900 | That looks like QEMU is dead | 19:43:34 |
K900 | But not like | 19:43:40 |
K900 | All the way dead | 19:43:42 |
K900 | But presumably dead enough to close the monitor socket? | 19:44:02 |
Janne Heß | it properly failed this time:
Process 43896: /nix/store/97w52ckcjnfiz89h3lh7zf1kysgfm2s8-python3-3.9.6/bin/python3 /nix/store/7v40kpl69d7ydhm2mz7wkl8q04yc8xly-nixos-test-driver/bin/.nixos-test-driver-wrapped
Python v3.9.6 (/nix/store/97w52ckcjnfiz89h3lh7zf1kysgfm2s8-python3-3.9.6/bin/python3.9)
Thread 0x7FFFF77EB340 (active)
_shutdown (threading.py:1448)
Thread 0x7FFFF6191640 (active)
process_serial_output (.nixos-test-driver-wrapped:931)
run (threading.py:910)
_bootstrap_inner (threading.py:973)
_bootstrap (threading.py:930)
| 19:45:27 |