Skip to content

GPU supervisor signal test: publish its handshake files atomically - #16535

Merged
danielhanchen merged 1 commit into
mainfrom
dh/gpu-supervisor-ready-atomic
Nov 3, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
dh/gpu-supervisor-ready-atomic

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Tauri Linux debug build fails intermittently on unrelated PRs in linux_gpu_supervisor::tests::pid_and_group_signals_reach_the_child_once, added in #15482. It hit #16524 today and fix/opt-in-startup-warmup yesterday, 2 of about 41 completed runs since Nov 1, with the same panic both times:

thread 'linux_gpu_supervisor::tests::pid_and_group_signals_reach_the_child_once' panicked at src/linux_gpu_supervisor.rs:1194:37:
index out of bounds: the len is 0 but the index is 0

Cause. The child writes its PIDs to ready with std::fs::write, which creates the file and then writes to it. The parent polls with read_to_string, and as soon as the read succeeds it parses the IDs. If the poll lands between the create and the write, the parent reads an empty string and indexes an empty list. The second panic in the log (NotFound at line 1125) follows from the first: the parent's tempdir is gone by the time the child writes cleaned. The parent polls cleaned the same way, so that check has the same race.

The supervisor code under test is fine. Only the test's handshake was racy.

Change

studio/src-tauri/src/linux_gpu_supervisor.rs, test module only: a small publish helper writes to <name>.tmp and renames it into place, so the parent sees either no file or the whole contents. Both ready and cleaned go through it. The signals, timeouts and assertions are unchanged.

Testing

  • cargo test --locked linux_gpu_supervisor: 20 passed.
  • Sabotage: I put a 100 ms sleep between the create and the write in the original std::fs::write of ready. The test then fails with exactly the CI panic above (the len is 0 but the index is 0).
  • With this change and the same 100 ms sleep between writing ready.tmp and the rename, the test passes 3 of 3.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T08:01:10.786645Z 77e8f4b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 77e8f4bc4b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 6b3ea78 into main Nov 3, 2026
@danielhanchen
danielhanchen deleted the dh/gpu-supervisor-ready-atomic branch November 3, 2026 08:06
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