mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-30686: Endless loop when trying to establish connection
With wsrep_sst_rsync, node goes into endless loop when trying to establish connection to donor for IST/SST if the database is bind on specific IP address, not the "*". This commit fixes this problem. Separate tests are not required - the problem can occur in normal configurations on a number of systems when selecting a bing address other than "*", especially on FreeBSD and with the IPv6 addresses.
This commit is contained in:
@@ -100,10 +100,9 @@ check_pid_and_port()
|
||||
local busy=0
|
||||
|
||||
if [ $lsof_available -ne 0 ]; then
|
||||
port_info=$(lsof -Pnl -i ":$port" 2>/dev/null | \
|
||||
grep -F '(LISTEN)')
|
||||
port_info=$(lsof -Pnl -i ":$port" 2>/dev/null | grep -F '(LISTEN)')
|
||||
echo "$port_info" | \
|
||||
grep -q -E "[[:space:]](\\*|\\[?::\\]?):$port[[:space:]]" && busy=1
|
||||
grep -q -E "[[:space:]]\\[?(\\*|[[:xdigit:]]*(:[[:xdigit:]]*)+)(\\](%[^:]+)?)?:$port[[:space:]]" && busy=1
|
||||
else
|
||||
local filter='([^[:space:]]+[[:space:]]+){4}[^[:space:]]+'
|
||||
if [ $sockstat_available -ne 0 ]; then
|
||||
@@ -122,7 +121,7 @@ check_pid_and_port()
|
||||
grep -F 'users:(' | grep -o -E "$filter")
|
||||
fi
|
||||
echo "$port_info" | \
|
||||
grep -q -E "[[:space:]](\\*|\\[?::\\]?):$port\$" && busy=1
|
||||
grep -q -E "[[:space:]]\\[?(\\*|[[:xdigit:]]*(:[[:xdigit:]]*)+)(\\](%[^:]+)?)?:$port\$" && busy=1
|
||||
fi
|
||||
|
||||
if [ $busy -eq 0 ]; then
|
||||
|
Reference in New Issue
Block a user