The directory layout of the agent's information places created persistent volumes under the agent's --work_dir:
When these persistent volumes are used, they will (on Linux) generally be mounted underneath the sandbox directory (also located under --work_dir). Upon termination of use, persistent volumes are unmounted by reading the mount table, and checking if any mount targets are under the sandbox:
However, when an agent's work directory is placed under a symlink, the same code above might not find any persistent volumes to remove. This is because the mount table shows the real location on disk, but the sandbox expects the symlinked location.
For example, suppose:
- The --work_dir is /var/run/mesos.
- /var/run/mesos is a symlink pointing to /tmp/link.
The agent will create sandboxes under paths like /var/run/mesos/slave/.../framework/.../.... The mount table however, will show mount targets like /tmp/link/slave/.../framework/.../.... Since the mount table target does not start with the sandbox path, the filesystem/linux isolator will not find any persistent volumes to clean up. The agent's garbage collector will also fail here, because it tries to unmount any persistent volumes under the agent's work directory.