Skip to content

fix(burn): trigger media-change via auto-eject so verify can mount#27

Merged
Xitee1 merged 1 commit into
mainfrom
fix/post-burn-verify-stale-media-cache
May 19, 2026
Merged

fix(burn): trigger media-change via auto-eject so verify can mount#27
Xitee1 merged 1 commit into
mainfrom
fix/post-burn-verify-stale-media-cache

Conversation

@Xitee1
Copy link
Copy Markdown
Owner

@Xitee1 Xitee1 commented May 19, 2026

Summary

  • Drop -use-the-force-luke=notray from growisofs so its default post-burn eject generates the kernel media-change event that invalidates the cached "Blank BD-R" state. Without it, the OS keeps seeing the pre-burn disc and udisks2 reports the freshly burned disc as not-mountable.
  • Add DiscIO.wait_for_disc_ready(): 10s post-eject settle pause, then eject -t (close-tray) retried on the schedule (0, 5, 15, 30, 50)s (5 attempts, 5/10/15/20s spacing) for tray-load drives. Slim drives that can't motor the tray fall through to passive polling — user pushes the disc in, no prompt, no hard timeout, Ctrl+C aborts.
  • Surface mount-failure stderr from tools/mount.py + tools/udisks.py (was swallowed before). This was what made the bug diagnosable: udisks2's "is not a mountable filesystem" combined with dvd+rw-mediainfo's "Disc status: appendable / Number of Sessions: 2" output pointed at the stale-cache hypothesis.
  • Removes now-obsolete DiscIO.refresh_toc(), DiscIO.close_tray_if_open(), and tools.mediainfo.probe() (SCSI probes do not invalidate the udisks2 media-type cache — only a real media-change event does).

Test plan

  • ruff check clean
  • Imports resolve; removed APIs gone, new API present
  • End-to-end: burn one disc on a full-size BD drive, confirm auto-eject + auto-close + verify pass
  • End-to-end: burn one disc on a slim BD drive, confirm passive polling kicks in after the 5 close-tray attempts, verify after manual re-insert
  • Confirm 10s post-eject pause is enough — if not, bump or move to deterministic "wait for drive_status to leave CDS_DISC_OK" before the close-tray schedule

🤖 Generated with Claude Code

After a burn with `-use-the-force-luke=notray` the kernel (and udisks2)
kept the disc cached as "Blank BD-R" — the state at burn-start. SCSI
probes via dvd+rw-mediainfo updated the kernel's TOC view but did not
invalidate the udisks2 media-type cache; only a real media-change event
does that. The post-burn verify therefore failed to mount until the
user physically ejected + re-inserted the disc.

Drop `-use-the-force-luke=notray` so growisofs performs its default
post-burn eject, which generates the media-change event the kernel
needs. `DiscIO.wait_for_disc_ready` then blocks until the disc is back
in: a 10s settle pause lets the eject motor finish, then `eject -t`
(close-tray) is retried on the schedule (0, 5, 15, 30, 50)s — five
attempts with 5/10/15/20s spacing — to handle slow tray motors without
racing the eject. Slim drives that can't motor the tray fall through
to passive polling on `drive_status`; the user pushes the disc in, no
prompt, no hard timeout, Ctrl+C aborts.

Also surface mount-failure stderr from `tools/mount.py` and
`tools/udisks.py` instead of swallowing it. That was what made this
diagnosable in the first place: udisks2's "is not a mountable
filesystem" message + `dvd+rw-mediainfo`'s "Disc status: appendable /
Number of Sessions: 2" output pointed at the stale-cache hypothesis.

Removes the now-obsolete `DiscIO.refresh_toc()`,
`DiscIO.close_tray_if_open()`, and `tools.mediainfo.probe()`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Xitee1 Xitee1 merged commit fcff4da into main May 19, 2026
1 check passed
@Xitee1 Xitee1 deleted the fix/post-burn-verify-stale-media-cache branch May 19, 2026 21:17
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