Can't connect to Oracle now and then

Hello,

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.
ORACLE_RETRY_LIMIT=${ORACLE_RETRY_LIMIT:-150}
ORACLE_RETRY_SLEEP=${ORACLE_RETRY_SLEEP:-2}
ORACLE_RETRY_COUNT=0

printf '⏳ Waiting for Oracle to start...'
until [[ "$(echo "exit;" | sqlplus -S "system/$ORACLE_SYSTEM_PASSWORD@$ORACLE_DATABASE")" == "" ]]
do
  ((ORACLE_RETRY_COUNT++)) && [ $ORACLE_RETRY_COUNT -gt "$ORACLE_RETRY_LIMIT" ] && {
    printf 'Failed!'
    exit 1
  }
  sleep "$ORACLE_RETRY_SLEEP"
  printf '.'
done
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.