Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.
C++
serve: the hardware sampler keeps running where psutil finds no disk counters
Chen Cheng8e9d3d0a1976
diff --git a/serve/telemetry.py b/serve/telemetry.pyindex 8a629e041..497ac9adc 100644--- a/serve/telemetry.py+++ b/serve/telemetry.py@@ -307,6 +307,8 @@ class Telemetry:c = self.ps.disk_io_counters()except (OSError, RuntimeError):return None, None+ if c is None: # psutil found no disk (a gVisor container, Windows with its disk counters off)+ return None, Nonet = time.time()prev, self._disk_prev = self._disk_prev, (t, c.read_bytes, c.write_bytes)if prev is None or t <= prev[0]:diff --git a/serve/test_server.py b/serve/test_server.pyindex 60e909e8f..368ac30fd 100644--- a/serve/test_server.py+++ b/serve/test_server.py@@ -3912,6 +3912,31 @@ class AmdTelemetry(unittest.TestCase):self.assertEqual(svc.free_vram_mib(), 26 << 10)+class TelemetryNoDisks(unittest.TestCase):+ """psutil.disk_io_counters() returns None where it finds no disk (a gVisor container; Windows with its disk counters+ off): the sampler goes on without a disk reading instead of its thread ending at the first sample, which left+ /metrics' hardware empty and the frozen-engine check's GPU reading at 0."""++ def test_sampler_runs_without_disk_counters(self):+ from serve import telemetry+ vm = SimpleNamespace(total=64 * 2**30, available=40 * 2**30)+ fake = SimpleNamespace(cpu_count=lambda logical=True: 8, cpu_percent=lambda interval=None: 12.5,+ virtual_memory=lambda: vm, disk_io_counters=lambda: None)+ with mock.patch.dict(sys.modules, {"psutil": fake}):+ t = telemetry.Telemetry(extra=lambda: {"tok_s": 1.5})+ try:+ deadline = time.monotonic() + 5.0+ while not t.snapshot()["now"] and time.monotonic() < deadline:+ time.sleep(0.05)+ now = t.snapshot()["now"]+ self.assertEqual(now.get("tok_s"), 1.5)+ self.assertEqual(now.get("ram_used"), 24 * 2**30)+ self.assertIsNone(now.get("disk_read_mb"))+ self.assertIsNone(t.sample()["disk_write_mb"])+ finally:+ t.close()++class SilentEngine(unittest.TestCase):"""#481: an engine that prints nothing for engine_silence_s during a request (or never acknowledges a STOP) haslost step with the server: it is ended and the request fails with EngineDied, instead of waiting forever."""