Commit 60644d0b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c6ea3739
...@@ -163,7 +163,7 @@ func (c *Client) talkMaster(ctx context.Context) (err error) { ...@@ -163,7 +163,7 @@ func (c *Client) talkMaster(ctx context.Context) (err error) {
// XXX dup wrt Storage.talkMaster // XXX dup wrt Storage.talkMaster
for { for {
err := c.talkMaster1(ctx) err := c.talkMaster1(ctx)
log.Error(ctx, err) log.Warning(ctx, err) // XXX Warning ok? -> Error?
// TODO if err = shutdown -> return // TODO if err = shutdown -> return
......
...@@ -154,7 +154,7 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) { ...@@ -154,7 +154,7 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) {
// XXX dup wrt Client.talkMaster // XXX dup wrt Client.talkMaster
for { for {
err := stor.talkMaster1(ctx) err := stor.talkMaster1(ctx)
log.Error(ctx, err) log.Warning(ctx, err) // XXX Warning ok? -> Error?
// TODO if err = shutdown -> return // TODO if err = shutdown -> return
...@@ -200,13 +200,13 @@ func (stor *Storage) talkMaster1(ctx context.Context) (err error) { ...@@ -200,13 +200,13 @@ func (stor *Storage) talkMaster1(ctx context.Context) (err error) {
// let master initialize us. If successful this ends with StartOperation command. // let master initialize us. If successful this ends with StartOperation command.
reqStart, err := stor.m1initialize(ctx, mlink) reqStart, err := stor.m1initialize(ctx, mlink)
if err != nil { if err != nil {
log.Error(ctx, err) //log.Error(ctx, err)
return err return err
} }
// we got StartOperation command. Let master drive us during servicing phase. // we got StartOperation command. Let master drive us during servicing phase.
err = stor.m1serve(ctx, reqStart) err = stor.m1serve(ctx, reqStart)
log.Error(ctx, err) //log.Error(ctx, err)
return err return err
} }
......
...@@ -31,6 +31,18 @@ xmysql() { ...@@ -31,6 +31,18 @@ xmysql() {
mysql --defaults-file=$mycnf "$@" mysql --defaults-file=$mycnf "$@"
} }
# if we are abnormally terminating
trap 'set +e
echo "E: abnormal termination - stopping..."
xneoctl set cluster stopping
sleep 1
xmysql -e "SHUTDOWN"
sleep 1
j="$(jobs -p)"
test -z "$j" && exit
echo "E: killing jobs..."
jobs -l
kill $j' EXIT
# ---- start NEO nodes ---- # ---- start NEO nodes ----
...@@ -271,6 +283,8 @@ done ...@@ -271,6 +283,8 @@ done
xneoctl set cluster stopping xneoctl set cluster stopping
wait wait
# all ok
trap - EXIT
exit exit
# ---------------------------------------- # ----------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment