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 the wait-for-it timeout configurable #109

Open
lambada opened this issue Apr 28, 2024 · 1 comment
Open

Make the wait-for-it timeout configurable #109

lambada opened this issue Apr 28, 2024 · 1 comment

Comments

@lambada
Copy link

lambada commented Apr 28, 2024

When running canasta create the DB container on my server takes a couple of minutes to come good. In the example logs below it took from 21:58:01 until 22:00:12 for the freshly created db to come good.

This is longer than the wait-for-it script allows

command := "/wait-for-it.sh -t 60 db:3306"
(Called by the create CLI command)

This timeout being non-configurable means that the create command bails out, and you can either keep the containers or cleanup. But the problem with keeping the containers/config is that there doesn't seem to be a way to re-run the create command with the same config so that the install command etc can be re-run now the DB is up. ie the following code doesn't appear to be able to be re-run

if _, err := mediawiki.Install(path, yamlPath, orchestrator, canastaInfo); err != nil {
return err
}
if err := config.Add(config.Installation{Id: canastaInfo.Id, Path: path, Orchestrator: orchestrator}); err != nil {
return err
}
if err := orchestrators.StopAndStart(path, orchestrator); err != nil {
log.Fatal(err)
}

Instead, rerunning create with the same args gives the following fatal error

fatal: destination path '/canasta/canasta1' already exists and is not an empty directory.

Allowing the timeout to be configurable would probably be an easier solution to this than attempting to rerun a partially-completed installation process.

$ docker logs canasta1-db-1
2024-04-28 21:58:01+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.33-1.el8 started.
<snip>
2024-04-28T22:00:12.657246Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2024-04-28T22:00:12.657287Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.33'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server - GPL.
@jeffw16
Copy link
Member

jeffw16 commented Apr 30, 2024

I agree that this is an issue that we should aim to resolve. @vedmaka do you think it would be feasible to allow the sysadmin to change wait-for-it.sh depending on how fast/slow the system is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants