Can't connect to Oracle now and then


Sometimes our build fails because we fail to establish a connection to the Oracle database.
We’re using the Oracle DB from DockerHub, which gets downloaded properly and setup, but for some reason in our parallel build, one of the workers now and then fails to establish the connection to the Oracle DB.

We use the following script to wait and connect to the DB:

#!/usr/bin/env bash
# Wait to connect to a running Oracle database, then exit.

printf '⏳ Waiting for Oracle to start...'
until [[ "$(echo "exit;" | sqlplus -S "system/$ORACLE_SYSTEM_PASSWORD@$ORACLE_DATABASE")" == "" ]]
    printf 'Failed!'
    exit 1
  printf '.'
printf 'OK!\n'

Which already waits pretty long, and I really don’t feel like extending the timeout even longer to make sure some connection gets established eventually. It’s also not reliably reproduceable.
Is there anything I could do to figure out why the connection would not work on the #3 worker for example while it works for all others in the build?

Nobody with this?
I still have builds failing now and then because the main container cannot get a response from the Oracle container.

Would really appreciate some input from CircleCI on this.