Skip to content

Commit

Permalink
Implement proper retry logic in ma-local/start
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-suse committed Jun 11, 2024
1 parent f53f24f commit fc3bf3d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions product/ma/local/start.sh.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ set -e
[ -d __workdir/dt ] || mkdir __workdir/dt
[ -f __datadir/ibdata1 ] || __workdir/init_datadir

/usr/sbin/mariadbd --datadir=__datadir --user=$USER --socket=__workdir/.sock --skip-networking --log-error=__workdir/.cerr --pid-file=__workdir/.pid "$@" &
eatmydata=$(which eatmydata 2>/dev/null) || :

$eatmydata /usr/sbin/mariadbd --datadir=__datadir --user=$USER --socket=__workdir/.sock --skip-networking --log-error=__workdir/.cerr --pid-file=__workdir/.pid "$@" &

sleep 0.1
__workdir/status >& /dev/null || sleep 0.1
__workdir/status >& /dev/null || sleep 0.1
__workdir/status >& /dev/null || sleep 0.1
__workdir/status >& /dev/null || sleep 0.1
__workdir/status >& /dev/null || sleep 0.1
__workdir/status >& /dev/null || sleep 0.1
__workdir/status >& /dev/null || sleep 1

(r=150; while ! __workdir/status >& /dev/null ; do ((--r))||exit 1; sleep 0.1 ;done)

0 comments on commit fc3bf3d

Please sign in to comment.