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

Allow IT Dockerfile to exit after all setup attempts fail #17592

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions integration-tests/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,19 @@ ARG ZK_VERSION
ARG APACHE_ARCHIVE_MIRROR_HOST=https://archive.apache.org
ARG SETUP_RETRIES=3
# Retry mechanism for running the setup script up to limit of 3 times.
RUN set -e; \
for i in $(seq 1 $SETUP_RETRIES); do \
echo "Attempt $i to run the setup script..."; \
RUN i=0; \
while [ $i -lt $SETUP_RETRIES ]; do \
APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && break || { \
i=$(($i + 1)); \
echo "Set up script attempt $i/$SETUP_RETRIES failed."; \
sleep 2; \
}; \
done; \
rm -f /root/base-setup.sh
rm -f /root/base-setup.sh; \
if [ "$i" -eq "$SETUP_RETRIES" ]; then \
exit 1; \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets put a message here mentioning gave up on retries.

Copy link
Contributor

@cryptoe cryptoe Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message like
Tried [$i] times to contact [$url]. Unable to do so. Try a different url or check connectivity

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like a fix-of-the-fix already #17543

I think this retry logic is completely misplaced; it seems to me that the original problem was that wget times out?
I think running all steps of the script will retry it even if other issues happen ...

I wonder why not specify some retry conditions for wget instead ?
https://unix.stackexchange.com/questions/227665/wget-abort-retrying-after-failure-or-timeout

fi


FROM druidbase
ARG MYSQL_VERSION
Expand Down
Loading