fix(host_agent): disks behind a RAID controller each keep their own name (#5806)
smartctl reports every disk behind a PERC/MegaRAID controller as /dev/bus/0 with type megaraid,N; the helper named a drive by its path alone, so all of VDNT-Docker02's and Docker03's disks read as one drive "0", each overwriting the last. The slot is now part of the name (bus0-megaraid3), and Steward gives a repeated name an ordinal so two drives never share a series. Agent 1.20.1. fix(ansible): Steward stopping mid-run logs no traceback (#5749) The run's done-callback called exception() on a cancelled task, which raises; it now logs a run cut short by shutdown at INFO. A finished run's in-memory state is dropped by a timer rather than a sleeping task, which shutdown found still pending. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -182,14 +182,17 @@ def deregister_listener(run_id: str, q: asyncio.Queue) -> None:
|
||||
listeners.remove(q)
|
||||
|
||||
|
||||
def _drop_run_state(run_id: str) -> None:
|
||||
_run_lines.pop(run_id, None)
|
||||
_run_done.pop(run_id, None)
|
||||
|
||||
|
||||
def _schedule_cleanup(run_id: str) -> None:
|
||||
"""Drop a finished run's in-memory state after a grace window."""
|
||||
async def _cleanup() -> None:
|
||||
await asyncio.sleep(_MEM_TTL_SECS)
|
||||
_run_lines.pop(run_id, None)
|
||||
_run_done.pop(run_id, None)
|
||||
"""Drop a finished run's in-memory state after a grace window. A timer,
|
||||
not a task (#5749): a run cut short by shutdown schedules this as the
|
||||
loop closes, and a sleeping task would be destroyed while pending."""
|
||||
try:
|
||||
asyncio.create_task(_cleanup())
|
||||
asyncio.get_running_loop().call_later(_MEM_TTL_SECS, _drop_run_state, run_id)
|
||||
except RuntimeError:
|
||||
pass # no running loop (e.g. tests) — fine to skip
|
||||
|
||||
|
||||
Reference in New Issue
Block a user