Project

General

Profile

Actions

Feature #7939

closed

[FUSE] If arv-mount cannot mount anything, report that on stderr, exit nonzero

Added by Brett Smith about 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
FUSE
Target version:
Start date:
12/03/2015
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
1.0

Description

Today, arv-mount daemonizes very early, before it initializes FUSE or makes any API calls. If those later steps fail, arv-mount will not give the user any indication of that. They'll just see that nothing is actually mounted. Examples of things that can go wrong:

  • The user doesn't have permission to use FUSE
  • The user specified --allow-other but user_allow_other is not set in /etc/fuse.conf
  • The user has a bad Arvados client configuration (wrong API server; invalid API token)
  • The user tried to mount a collection that they can't read

When nothing can be mounted as a consequence of user or administrator error, that error should be reported on stderr, and arv-mount should exit nonzero, so the user immediately knows that there's been a problem, and ideally gets details about what that problem is. For the scope of this story, errors from uncaught exceptions are fine. Obviously we want better error reporting, but that can happen in a later story.

We've tried to fix this in the past, but it's non-trivial because our daemonization code closes all file descriptors by default, and FUSE initialization opens /dev/fuse, with no apparent API to find the file descriptor it's using. See f573c35a8f.

Fix:

  • Never daemonize (call self.daemon_ctx.open) until we're about to call llfuse.main().
  • When we construct the DaemonContext, pass preserve_files=range(3, number of inodes limit). Anything arv-mount opens, we trust it to need after daemonization.
  • Make a users/current API call immediately after parsing command-line arguments. This ensures that we can make API calls generally.
  • Write integration tests to simulate each of the above error conditions. It should be possible to just start arv-mount normally and test for a nonzero exit code. Ensure that you always unmount no matter what exit code you got.

Subtasks 1 (0 open1 closed)

Task #7999: Review 7939-arv-mount-errorsResolvedPeter Amstutz12/03/2015

Actions
Actions

Also available in: Atom PDF