Skip to content

Fix crash on unmount when busy with other processes - #2823

Merged
vjr merged 5 commits into
mainfrom
jeremypw/fix-crash-on-unmount
Sep 3, 2026
Merged

Fix crash on unmount when busy with other processes#2823
vjr merged 5 commits into
mainfrom
jeremypw/fix-crash-on-unmount

Conversation

@jeremypw

@jeremypw jeremypw commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes #2821

  • Use a custom MountOperation
  • Show our own dialog for showing other processes
  • Always abort for now

For simplicity a Granite.MessageDialog is used for now.
Screenshot from 2026-08-31 18 03 13

A problem is that if the competing process is FlatPak'd which is likely, the name of the competing process may well be that of a portal, not the original process. Not sure how to get round that.

In principle we could offer additional choices such forcing the unmount or ending the competing processes but that is left for design input.

@jeremypw
jeremypw requested review from a team and vjr September 2, 2026 10:37

@vjr vjr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me in a couple of tests except when using the Code app.

Fixes (prevents) crash-on-unmount while transferring files and while editing a file in VIM but there's maybe something in the way the Code app works I can still unmount and remount while editing a file in Code but that seems to be an issue in Code not this fix.

This can be merged for sure, any further fixes if required can be left for future PRs.

@vjr
vjr merged commit f73c4ed into main Sep 3, 2026
4 checks passed
@vjr
vjr deleted the jeremypw/fix-crash-on-unmount branch September 3, 2026 03:09
@jeremypw

jeremypw commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@vjr I think Code closes the document file after every update (and keeps a copy of its content in the text buffer) so mostly does not appear to be using it. Maybe we should mark open document files as in use?

@vjr

vjr commented Sep 3, 2026

Copy link
Copy Markdown
Member

@vjr I think Code closes the document file after every update (and keeps a copy of its content in the text buffer) so mostly does not appear to be using it. Maybe we should mark open document files as in use?

Where does this "mark open files as in use" change need to happen? Would you mind filing an issue ticket in the proper repo? I'm not sure whether it's supposed to be (likely?) Code or (unlikely?) Files.

@jeremypw

jeremypw commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@vjr At the moment, Code handles the situation of unmounting the source of a document while there are unsaved changes by showing a dialog:

Screenshot from 2026-09-03 17 16 57

This gives the user the chance to remount the source or save changes elsewhere.

If there are no unsaved changes, the document just closes.

I presume that if the unmount was requested during a lengthy save from Code (normally documents are not large enough to take a significant time to save) then a "busy" dialog would be shown (after this PR). I'll check what other editors do.

@jeremypw

jeremypw commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@vjr I checked Gnome Text Editor (FlatPak as native install gave weird behaviour on Wayland) and this did not inhibit unmounting a USB stick containing the file being edited. The dialog when saving after that was less helpful than Code - it simply gave an error that the file did not exist.

@jeremypw

jeremypw commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Nevertheless I'll raise an issue to see what comments arise.

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.

App crashes when trying to unmount a volume being used by another app

2 participants