accessing /dev/zfs is dependent on loading the zfs module which may take
some time for udev to do it's work to create /dev/zfs.  However, ZFS
does allow this to be tweaked with the ZFS_MODULE_TIMEOUT environment
variable:

>From lib/libzfs/libzfs_util.c, libzfs_load_module:

/*
 * Device creation by udev is asynchronous and waiting may be
 * required.  Busy wait for 10ms and then fall back to polling every
 * 10ms for the allowed timeout (default 10s, max 10m).  This is
 * done to optimize for the common case where the device is
 * immediately available and to avoid penalizing the possible
 * case where udev is slow or unable to create the device.
 */
        
timeout_str = getenv("ZFS_MODULE_TIMEOUT");
...

so export ZFS_MODULE_TIMEOUT=0 may be a useful workaround for the
moment.  I wonder if that could be set automagically to zero lxc
environment rather than hacking around zfs to detect if it is in a lxc
container. The former does seem the best way forward.


** Also affects: lxd (Ubuntu)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1760173

Title:
  zfs, zpool commands hangs for 10 seconds without a /dev/zfs

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxd/+bug/1760173/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to