cryptomator / cryptomator/cryptomator

Show processes which are blocking the locking

Open
#1,324 4 comments 1 reaction 0 assignees View on GitHub
misc:help-wanted
Dominant language
Java
Stars
16.1k
Forks
1.5k
Avg merge
2d 45m
Merged PRs (30d)
1

Description

### Summary

Show (in the UI) the processes which are blocking the locking.

### Motivation

I wanted to lock the vault which did not work because some process stalled but did not free the file handle. I had to kill the blocking process manually. It was not clear which process was blocking the locking.

See log
```
10:21:06.150 [JavaFX Application Thread] WARN o.cryptomator.ui.quit.QuitController - Locking failed
java.util.concurrent.ExecutionException: org.cryptomator.common.vaults.Volume$VolumeException: org.cryptomator.frontend.fuse.mount.CommandFailedException: Command failed with exit code 1. Expected 0. Stderr: fusermount: failed to unmount /home/user/.local/share/Cryptomator/mnt/PbyTnS0ZRyfi_0: Device or resource busy

at java.base/java.util.concurrent.FutureTask.report(Unknown Source)
at java.base/java.util.concurrent.FutureTask.get(Unknown Source)
at org.cryptomator.ui.common.VaultService$WaitForTasksTask.call(VaultService.java:139)
at org.cryptomator.ui.common.VaultService$WaitForTasksTask.call(VaultService.java:124)
at javafx.concurrent.Task$TaskCallable.call(Task.java:1425)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

```

### Considered Alternatives

I used
```
$ fuser -vm /home/user/.local/share/Cryptomator/mnt/PbyTnS0ZRyfi_0/
```
to find the blocking process. ```lsof``` did not work. (Ubuntu 20.04)

Contributor guide

Open the contributing guide

Research direction

Start with the locking failure path in org.cryptomator.ui.common.VaultService (including lines 124 and 139 in the reported stack trace), then inspect QuitController and the FUSE mount command that reports the busy device. Review the reported fuser command on Ubuntu and determine how its results could reach the UI; done means a failed lock identifies the blocking processes to the user.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, linux
Domain
desktop, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.