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
Source or binary build?
Source, gazebo11 branch, version 11.12.0 (I don't have access to the specific commit)
Description
Expected behavior: I needed to automate stepping through a simulation, so I repeatedly called gz world -s. I expected to be able to run this indefinitely.
Actual behavior: After a while, gazebo crashes, printing the following message:
getifaddres: Too many open files
terminate called after throwing an instance of 'gazebo::common::Exception'
Over time, there is an increasing number of CLOSE_WAIT sockets, which are likely what is causing gazebo to crash.
Steps to reproduce
In a terminal, launch gazebo in paused mode: gazebo -u
In another terminal, call gz world -s over and over. See the example bash script below.
(optional) In another terminal, look at the output of lsof | grep gz | grep CLOSE_WAIT over time (it will grow in size).
After a while, gazebo will crash, printing the message reported above. On my machine, this happens after approximately 1600 iterations.
SAMPLE SCRIPT:
#!/bin/bash
for ((i=1; i<=10000; i++)); do
echo "Running iteration $i"
gz world -s
done
Output
Terminal output:
$ gazebo -u
getifaddres: Too many open files
terminate called after throwing an instance of 'gazebo::common::Exception'
Sample of lsof | grep gz | grep CLOSE_WAIT output:
Publish to the new /world_control gz-transport topic
to avoid the issue with too many open files after
running `gz world` repeatedly.
Fixes#3341.
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
I briefly experimented with improving the shutdown behavior of classic gazebo_transport (using boost Asia) objects but did not find quick results, so I instead modified the gz world command to publish using gz-transport (using ZeroMQ) and added corresponding subscribers to the World and any other classes that currently subscribe to ~/world_control (see #3374). It appears to fix the issue with running gz world repeatedly.
This fixes the issue with unclosed sockets leading to
"too many open files" errors after repeated runs of
`gz world` by adding a gz-transport /world_control
topic alongside the ~/world_control classic topic.
This works because gz-transport does a better job
closing sockets.
Subscribers to /world_control are added alongside
any existing subscribers to ~/world_control and the
`gz world` tool is changed to publish only on
/world_control.
Fixes#3341.
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Environment
Source, gazebo11 branch, version 11.12.0 (I don't have access to the specific commit)
Description
gz world -s
. I expected to be able to run this indefinitely.Over time, there is an increasing number of
CLOSE_WAIT
sockets, which are likely what is causing gazebo to crash.Steps to reproduce
gazebo -u
gz world -s
over and over. See the example bash script below.lsof | grep gz | grep CLOSE_WAIT
over time (it will grow in size).SAMPLE SCRIPT:
Output
Terminal output:
Sample of
lsof | grep gz | grep CLOSE_WAIT
output:The text was updated successfully, but these errors were encountered: