[PR #1593] [CLOSED] serve: the hardware sampler keeps running where psutil finds no disk counters #3550

Closed
opened 2026-11-07 14:42:16 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1593
Author: @ischencheng
Created: 10/8/2026
Status: ❌ Closed

Base: main ← Head: fix/telemetry-no-disk-counters


📝 Commits (1)

  • 3698dd6 serve: the hardware sampler keeps running where psutil finds no disk counters

📊 Changes

2 files changed (+27 additions, -0 deletions)

View changed files

📝 serve/telemetry.py (+2 -0)
📝 serve/test_server.py (+25 -0)

📄 Description

psutil.disk_io_counters() returns None when it finds no disk. On Modal (gVisor, no /proc/diskstats) that happens on every start, and psutil's docs say Windows can need diskperf -y before it sees one. _disk() then raises at the first sample and the sampler thread ends:

  File "serve/telemetry.py", line 311, in _disk
    prev, self._disk_prev = self._disk_prev, (t, c.read_bytes, c.write_bytes)
AttributeError: 'NoneType' object has no attribute 'read_bytes'

After that /metrics returns an empty hardware, the Monitor tab has nothing to show, and the frozen-engine check's gpu_busy() (#1317) always reads a GPU load of 0. hulkbig's #1583 mentions the same error in its test run.

The fix returns no disk reading in that case, like the OSError branch above it. The other readings go on as before.

Tested:

  • New TelemetryNoDisks test in serve/test_server.py, with a fake psutil whose disk counters are None: it fails on main with the traceback above and passes here. serve/test_server.py (272 tests), test_monitor, test_prometheus, test_responses, test_lifecycle and test_parallel pass.
  • Modal L4 24 GB, Linux (gVisor), engine 0.1.41 built from fb58e0d, IQ2_XS, the same config for both runs: one short request, then /metrics.
main this branch
keys in hardware 0 19
samples in history 0 9
sampler traceback in the server log yes no

The reply was the same in both runs. Not tested on Windows, and I did not try to trigger the frozen-engine check itself.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1593 **Author:** [@ischencheng](https://github.com/ischencheng) **Created:** 10/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/telemetry-no-disk-counters` --- ### 📝 Commits (1) - [`3698dd6`](https://github.com/Niko1221/Strata/commit/3698dd6d18f4028e1277d9b15b04e6d6ccad11f3) serve: the hardware sampler keeps running where psutil finds no disk counters ### 📊 Changes **2 files changed** (+27 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `serve/telemetry.py` (+2 -0) 📝 `serve/test_server.py` (+25 -0) </details> ### 📄 Description `psutil.disk_io_counters()` returns None when it finds no disk. On Modal (gVisor, no /proc/diskstats) that happens on every start, and psutil's docs say Windows can need `diskperf -y` before it sees one. `_disk()` then raises at the first sample and the sampler thread ends: ``` File "serve/telemetry.py", line 311, in _disk prev, self._disk_prev = self._disk_prev, (t, c.read_bytes, c.write_bytes) AttributeError: 'NoneType' object has no attribute 'read_bytes' ``` After that `/metrics` returns an empty `hardware`, the Monitor tab has nothing to show, and the frozen-engine check's `gpu_busy()` (#1317) always reads a GPU load of 0. hulkbig's #1583 mentions the same error in its test run. The fix returns no disk reading in that case, like the `OSError` branch above it. The other readings go on as before. Tested: - New `TelemetryNoDisks` test in serve/test_server.py, with a fake psutil whose disk counters are None: it fails on main with the traceback above and passes here. serve/test_server.py (272 tests), test_monitor, test_prometheus, test_responses, test_lifecycle and test_parallel pass. - Modal L4 24 GB, Linux (gVisor), engine 0.1.41 built from fb58e0d, IQ2_XS, the same config for both runs: one short request, then `/metrics`. | | main | this branch | |---|---|---| | keys in `hardware` | 0 | 19 | | samples in `history` | 0 | 9 | | sampler traceback in the server log | yes | no | The reply was the same in both runs. Not tested on Windows, and I did not try to trigger the frozen-engine check itself. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:42:16 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3550
No description provided.