You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current implementation, get_mount_facts calls the lsblk binary to get the uuid of each device (first field of a line starting with /, such as those lines above). This means that lsblk is being called here many times to get the uuid of the same /dev/dm-0 device. That many calls make the function end up timing out.
Since the uuid of /dev/dm-0 is always going to be the same, all these calls could be avoided by caching the results of the first lsblk /dev/dm-0 execution.
Steps To Reproduce:
Setup a large number of bind-mounts on a test machine test. Run ansible -m setup test.
Expected Results:
You get the machine's facts.
Actual Results:
test | FAILED! => {
"changed": false,
"cmd": "/bin/lsblk -ln --output UUID /dev/dm-0",
"failed": true,
"msg": "Traceback (most recent call last):\n File \"<stdin>\", line 1999, in run_command\n File \"<stdin>\", line 2156, in _handle_timeout\nTimeoutError: Timer expired\n",
"rc": 257
}
The text was updated successfully, but these errors were encountered:
kilburn
changed the title
Unnecessary /bin/lsblk executions in the get_mount_facts function of the setup module
Unnecessary /bin/lsblk executions in the get_mount_facts function of the setup module
Feb 18, 2016
kilburn
added a commit
to kilburn/ansible
that referenced
this issue
Feb 18, 2016
The setup module calls /bin/lsblk once for each device appearing in the /etc/mtab file. However, the same device appears there mutliple times when the system uses bind-mounts. As a result, /bin/lsblk is being called repeatedly to get the uuid of the same device.
On a system with many mounts, this leads to a TimeoutError in the get_mount_facts function of the setup module as described in ansible#14551.
Fixesansible#14551
The setup module calls /bin/lsblk once for each device appearing in the /etc/mtab file. However, the same device appears there mutliple times when the system uses bind-mounts. As a result, /bin/lsblk is being called repeatedly to get the uuid of the same device.
On a system with many mounts, this leads to a TimeoutError in the get_mount_facts function of the setup module as described in #14551.
Fixes#14551
Issue Type:
Ansible Version:
Ansible Configuration:
None relevant.
Environment:
Controller is OS X 10.10.5, the managed OS is Debian Jessie 8.3 (fully updated at the time of this writing).
Summary:
This is probably related to #10779. Function
get_mount_facts
times out on my test machine, throwing the following error:The root cause is that, to setup multiple chroots, my test machine has many bind mounted paths. These paths appear in
/etc/mtab
, for instance:In the current implementation,
get_mount_facts
calls thelsblk
binary to get the uuid of each device (first field of a line starting with/
, such as those lines above). This means thatlsblk
is being called here many times to get the uuid of the same/dev/dm-0
device. That many calls make the function end up timing out.Since the uuid of
/dev/dm-0
is always going to be the same, all these calls could be avoided by caching the results of the firstlsblk /dev/dm-0
execution.Steps To Reproduce:
Setup a large number of bind-mounts on a test machine
test
. Runansible -m setup test
.Expected Results:
You get the machine's facts.
Actual Results:
The text was updated successfully, but these errors were encountered: