mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-08-08 09:21:48 +08:00
tests: attempt to fix disconnect-user race that caused 300 s timeouts
After the occtl disconnect, poll 'occtl show user test' until the session is gone before attempting the reconnect. This guarantees that session_close() has already returned and main's event loop is free to process the reconnect worker's AUTH_COOKIE_REQ. Addresses intermittent failures observed in the Fedora, CentOS9, and CentOS10 CI jobs. Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
@@ -96,6 +96,14 @@ if test $? != 0;then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Wait for main + sec-mod to finish session cleanup before reconnecting;
|
||||
# without this, session_close() blocks main's event loop and the reconnect
|
||||
# worker's AUTH_COOKIE_REQ goes unread, causing a deadlock.
|
||||
for i in $(seq 1 10); do
|
||||
${OCCTL} -s ${OCCTL_SOCKET} show user test >/dev/null 2>&1 || break
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo " * Re-connecting to obtain cookie after disconnect... "
|
||||
( ${CMDNS1} ${OPENCONNECT} -q ${ADDRESS}:${PORT} -u test --servercert=pin-sha256:xp3scfzy3rOQsv9NcOve/8YVVv+pHr4qNCXEXrNl5s8= -s ${srcdir}/scripts/vpnc-script -C "${COOKIE}" --pid-file=${CLIPID2} -b )
|
||||
if test $? = 0;then
|
||||
|
||||
@@ -91,6 +91,14 @@ if test $? != 0;then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Wait for main + sec-mod to finish session cleanup before reconnecting;
|
||||
# without this, session_close() blocks main's event loop and the reconnect
|
||||
# worker's AUTH_COOKIE_REQ goes unread, causing a deadlock.
|
||||
for i in $(seq 1 10); do
|
||||
${OCCTL} -s ${OCCTL_SOCKET} show user test >/dev/null 2>&1 || break
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo " * Re-connecting to obtain cookie after disconnect... "
|
||||
( ${CMDNS1} ${OPENCONNECT} -q ${ADDRESS}:${PORT} -u test --servercert=pin-sha256:xp3scfzy3rOQsv9NcOve/8YVVv+pHr4qNCXEXrNl5s8= -s ${srcdir}/scripts/vpnc-script -C "${COOKIE}" --pid-file=${CLIPID} -b )
|
||||
if test $? = 0;then
|
||||
|
||||
Reference in New Issue
Block a user