!RROtHmAaQIkiJzJZZE:nixos.org

NixOS Infrastructure

424 Members
Next Infra call: 2024-07-11, 18:00 CEST (UTC+2) | Infra operational issues backlog: https://github.com/orgs/NixOS/projects/52 | See #infra-alerts:nixos.org for real time alerts from Prometheus.133 Servers

Load older messages


SenderMessageTime
21 Oct 2021
@janne.hess:helsinki-systems.deJanne Heßhmb19:46:39
@janne.hess:helsinki-systems.deJanne Heßhangs again, same stack19:48:43
@k900:0upti.meK900Does the process get killed?19:48:55
@janne.hess:helsinki-systems.deJanne HeßI already killed the runner, wait a minute19:49:04
@janne.hess:helsinki-systems.deJanne Heß(or two…)19:49:08
@k900:0upti.meK900If QEMU is ignoring SIGKILL, we're extremely fucked tbh19:49:43
@janne.hess:helsinki-systems.deJanne Heßqemu is still there19:52:12
@k900:0upti.meK900Uhh19:52:36
@k900:0upti.meK900That is not a good sign19:52:40
@k900:0upti.meK900Stack trace?19:52:47
@janne.hess:helsinki-systems.deJanne Heßqemu or python?19:52:57
@k900:0upti.meK900QEMU19:53:10
@janne.hess:helsinki-systems.deJanne Heß
/proc/44797/task/44797/stack
[<0>] do_sys_poll+0x3ab/0x5b0
[<0>] __x64_sys_ppoll+0xbc/0x150
[<0>] do_syscall_64+0x33/0x40
[<0>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
/proc/44797/task/44805/stack
[<0>] futex_wait_queue_me+0xb6/0x110
[<0>] futex_wait+0xe9/0x240
[<0>] do_futex+0x174/0xbf0
[<0>] __x64_sys_futex+0x146/0x1c0
[<0>] do_syscall_64+0x33/0x40
[<0>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
/proc/44797/task/44810/stack
[<0>] kvm_vcpu_block+0x58/0x2f0 [kvm]
[<0>] kvm_arch_vcpu_ioctl_run+0x6c4/0x1720 [kvm]
[<0>] kvm_vcpu_ioctl+0x211/0x5a0 [kvm]
[<0>] __x64_sys_ioctl+0x83/0xb0
[<0>] do_syscall_64+0x33/0x40
[<0>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
/proc/44797/stack
[<0>] do_sys_poll+0x3ab/0x5b0
[<0>] __x64_sys_ppoll+0xbc/0x150
[<0>] do_syscall_64+0x33/0x40
[<0>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
19:53:31
@k900:0upti.meK900What state is the QEMU process in?19:54:03
@janne.hess:helsinki-systems.deJanne Heßsleeping19:54:07
@k900:0upti.meK900Try to SIGKILL it manually?19:54:42
@k900:0upti.meK900Oh god wait fuck 19:56:00
@k900:0upti.meK900I think I know what the problem is19:56:05
@janne.hess:helsinki-systems.deJanne Heßyeah that works19:56:06
@k900:0upti.meK900It could be ordering the atexit hooks wrong19:56:28
@k900:0upti.meK900I'm not sure if they have a deterministic order19:56:36
@k900:0upti.meK900
diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py
index 3ee8b3227c6..dd50696bfce 100755
--- a/nixos/lib/test-driver/test-driver.py
+++ b/nixos/lib/test-driver/test-driver.py
@@ -8,7 +8,6 @@ import queue
 import io
 import threading
 import argparse
-import atexit
 import base64
 import codecs
 import os
@@ -1128,11 +1127,13 @@ class Driver:
             for cmd in cmd(start_scripts)
         ]

-        @atexit.register
-        def clean_up() -> None:
-            with rootlog.nested("clean up"):
-                for machine in self.machines:
-                    machine.release()
+    def __enter__(self):
+        return self
+
+    def __exit__(self, *_):
+        with rootlog.nested("clean up"):
+            for machine in self.machines:
+                machine.release()

     def subtest(self, name: str) -> Iterator[None]:
         """Group logs under a given test name"""
@@ -1307,14 +1308,13 @@ if __name__ == "__main__":
     if not args.keep_vm_state:
         rootlog.info("Machine state will be reset. To keep it, pass --keep-vm-state")

-    driver = Driver(
+    with Driver(
         args.start_scripts, args.vlans, args.testscript.read_text(), args.keep_vm_state
-    )
-
-    if args.interactive:
-        ptpython.repl.embed(driver.test_symbols(), {})
-    else:
-        tic = time.time()
-        driver.run_tests()
-        toc = time.time()
-        rootlog.info(f"test script finished in {(toc-tic):.2f}s")
+    ) as driver:
+        if args.interactive:
+            ptpython.repl.embed(driver.test_symbols(), {})
+        else:
+            tic = time.time()
+            driver.run_tests()
+            toc = time.time()
+            rootlog.info(f"test script finished in {(toc-tic):.2f}s")
19:58:16
@k900:0upti.meK900Try this19:58:17
@k900:0upti.meK900Ugh20:02:35
@k900:0upti.meK900mypy20:02:36
@k900:0upti.meK900
    def __enter__(self) -> "Driver":
        return self

    def __exit__(self, *_: Any) -> None:
        with rootlog.nested("clean up"):
            for machine in self.machines:
                machine.release()
20:02:38
@k900:0upti.meK900This should be correct (with type hints added)20:02:45
@janne.hess:helsinki-systems.deJanne Heß it exits \o/ 20:06:13
@k900:0upti.meK900Run it a few more times? 20:07:10
@janne.hess:helsinki-systems.deJanne Heßdoing that rn20:07:19

Show newer messages


Back to Room ListRoom Version: 6