Skip to content

End nvidia-smi with the plugin on Windows, however the plugin ends - #5

Merged
Virgile-pct merged 2 commits into
mainfrom
fix/nvidia-smi-job
Oct 29, 2026
Merged

Virgile-pct merged 2 commits into
mainfrom
fix/nvidia-smi-job

Conversation

@Virgile-pct

Copy link
Copy Markdown
Collaborator

On Windows, a plugin ended outright (the host killed, a console closed, taskkill /F) left its nvidia-smi --loop-ms=1000 running for good: kill_on_drop only runs when the plugin unwinds, and nvidia-smi keeps going after its stdout pipe closes. On Linux the closed pipe ends it, so this is Windows only.

nvidia-smi now runs in a job object created with JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE. The plugin holds the only handle to it while it samples, and Windows closes that handle whichever way the plugin ends, which ends nvidia-smi. If the job cannot be created or assigned, sampling goes on as before and the plugin says nvidia-smi may outlive it.

windows-sys 0.61 was already in the lockfile through tokio.

Checked:

  • a unit test (Windows) puts a long-running child in the job, drops the job, and requires the child to exit
  • on a desktop with an RTX 4070 Ti, a mesh-llm node with the packaged plugin, stopped the hard way: before this change it left an orphan nvidia-smi 3 times out of 3 (one still running 25 minutes later), with it none
  • killing only the plugin with taskkill /F while the node runs: its nvidia-smi was gone 0.3 s later, and the host's restarted plugin started its own

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d1a53810-04f3-4dfc-b677-ba0c4822647b
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

kill_on_drop only runs when the plugin unwinds. Killed outright, it left
nvidia-smi --loop-ms running for good on Windows. nvidia-smi now runs in a
job object with KILL_ON_JOB_CLOSE, whose handle Windows closes with the
plugin process.
@Virgile-pct
Virgile-pct merged commit baab54a into main Oct 29, 2026
9 checks passed
@Virgile-pct
Virgile-pct deleted the fix/nvidia-smi-job branch October 30, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant