Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly apply fix for high ulimit #2192

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions NodeBase/start-novnc.sh
VietND96 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ if [ "${START_XVFB:-$SE_START_XVFB}" = true ] ; then
if [ "${START_NO_VNC:-$SE_START_NO_VNC}" = true ] ; then

# Guard against unreasonably high nofile limits. See https://github.com/SeleniumHQ/docker-selenium/issues/2045
ULIMIT=${SE_VNC_ULIMIT:-100000}
if [[ ${ULIMIT} -ge 100000 ]]; then
echo "Trying to update the open file descriptor limit from $(ulimit -n) to ${ULIMIT}."
ulimit -Sv ${ULIMIT}
# Try to set a new limit if the current limit is too high, or the user explicitly specified a custom limit
TOO_HIGH_ULIMIT=100000
if [[ $(ulimit -n) -gt $TOO_HIGH_ULIMIT || ! -z "${SE_VNC_ULIMIT}" ]]; then
NEW_ULIMIT=${SE_VNC_ULIMIT:-${TOO_HIGH_ULIMIT}}
echo "Trying to update the open file descriptor limit from $(ulimit -n) to ${NEW_ULIMIT}."
ulimit -n ${NEW_ULIMIT}
if [ $? -eq 0 ]; then
echo "Successfully update the open file descriptor limit."
echo "Successfully updated the open file descriptor limit."
else
echo "The open file descriptor limit could not be updated."
fi
Expand Down
12 changes: 7 additions & 5 deletions NodeBase/start-vnc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ if [ "${START_XVFB:-$SE_START_XVFB}" = true ] ; then
done

# Guard against unreasonably high nofile limits. See https://github.com/SeleniumHQ/docker-selenium/issues/2045
ULIMIT=${SE_VNC_ULIMIT:-100000}
if [[ ${ULIMIT} -ge 100000 ]]; then
echo "Trying to update the open file descriptor limit from $(ulimit -n) to ${ULIMIT}."
ulimit -Sv ${ULIMIT}
# Try to set a new limit if the current limit is too high, or the user explicitly specified a custom limit
TOO_HIGH_ULIMIT=100000
if [[ $(ulimit -n) -gt $TOO_HIGH_ULIMIT || ! -z "${SE_VNC_ULIMIT}" ]]; then
NEW_ULIMIT=${SE_VNC_ULIMIT:-${TOO_HIGH_ULIMIT}}
echo "Trying to update the open file descriptor limit from $(ulimit -n) to ${NEW_ULIMIT}."
ulimit -n ${NEW_ULIMIT}
if [ $? -eq 0 ]; then
echo "Successfully update the open file descriptor limit."
echo "Successfully updated the open file descriptor limit."
else
echo "The open file descriptor limit could not be updated."
fi
Expand Down
Loading