docker-images icon indicating copy to clipboard operation
docker-images copied to clipboard

Default HEALTHCHECKs for 19c and 21c aren't enough for first initialization

Open felipecrs opened this issue 3 years ago • 1 comments

They can be easily tested with docker compose up --wait oracle for a docker-compose.yaml like below:

services:
  oracle:
    image: oracle:21.3.0

The outcome is that the command will return a failure before Oracle DB gets initialized. That's because the default HEALTHCHECK which comes with the Dockerfiles simply aren't sufficient for the first initialization.

By default, it disregards the first 5 minutes of tries (--start-period), then try 3 times (the default --retries) with 1 minute of interval, and gives up (puts the container in unhealthy state, which causes docker-compose --wait to exit with an error).

In my tests, it almost always takes at least 9 minutes in the first initialization. The default healthcheck gives up at 7-8 minutes.

I fixed this issue in my docker-compose.yaml by adding:

services:
  oracle:
    image: oracle:21.3.0
  healthcheck:
    retries: 10

I understand that the HEALTHCHECK is something meant to be customized by the end-user according to their needs, but I also believe that we can come up with a better default. I'm testing the database without any customization (no initdb), and in a powerful machine (16 CPUs + 64GB of RAM).

I'm opening this issue instead of just simply sending a PR because I don't know which option is the best:

  • Increasing the number of retries (--retries)
  • Increasing the start period (--start-period)

What do you guys think?

felipecrs avatar Sep 15 '22 00:09 felipecrs

I just tested here, 19.3.0 takes almost 20 minutes to start for the first time (21.3.0 takes 10 minutes as mentioned).

felipecrs avatar Sep 15 '22 00:09 felipecrs