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

Make temp server wait timeout configurable #646

Closed
yosifkit opened this issue Mar 4, 2020 · 2 comments
Closed

Make temp server wait timeout configurable #646

yosifkit opened this issue Mar 4, 2020 · 2 comments
Labels
Request Request for image modification or feature

Comments

@yosifkit
Copy link
Member

yosifkit commented Mar 4, 2020

Combining issues and PRs about increasing the timeout into one so we can discuss the best solution.

I think it makes sense to have a configurable timeout for the local-only server (and maybe even a "never timeout" option like -1). We'll need to ensure that the documentation is clear that this just applies to waiting for the temporary server to be ready and does not apply to the overall time taken by initdb stuff (like the user/db/password, tzinfo, and initdb.d scripts). Maybe something like MYSQL_TEMP_SERVER_WAIT_TIMEOUT?

Note: the timeout would not apply to 8.0+ since it has --daemonize that just takes care of it (only returns when the server is ready for connections).

docker_temp_server_start() {
if [ "${MYSQL_MAJOR}" = '5.6' ] || [ "${MYSQL_MAJOR}" = '5.7' ]; then
"$@" --skip-networking --socket="${SOCKET}" &
mysql_note "Waiting for server startup"
local i
for i in {30..0}; do
# only use the root password if the database has already been initializaed
# so that it won't try to fill in a password file when it hasn't been set yet
extraArgs=()
if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
extraArgs+=( '--dont-use-mysql-root-password' )
fi
if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then
break
fi
sleep 1
done
if [ "$i" = 0 ]; then
mysql_error "Unable to start server."
fi
else
# For 5.7+ the server is ready for use as soon as startup command unblocks
if ! "$@" --daemonize --skip-networking --socket="${SOCKET}"; then
mysql_error "Unable to start server."
fi
fi
}


Related issues: MariaDB/mariadb-docker#260, MariaDB/mariadb-docker#272, #159, #288

@tianon
Copy link
Member

tianon commented Jun 8, 2022

I'm inclined to close this 🙈

@yosifkit
Copy link
Member Author

I agree. With no responses or reactions we should consider this unwanted for now.

@yosifkit yosifkit closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request Request for image modification or feature
Projects
None yet
Development

No branches or pull requests

3 participants