on_shutdown= (empty initially)
loops until
$on_shutdown is empty (again)
AND
$guests is empty (expects remove of handled guests)
Then counts current $on_shutdown vs $PARALLEL_SHUTDOWN target.
Makes $guests the arguments vais "set --"
Picks $1 as guest
Shifts $1 out of the args
guests is assigned the remaining guests.
TL;DR This popped $1 into $guest and shrunk $guests by 1
Checks if this popped val is already in $on_shutdown
Gets a guest name
Calls shutdown_guest_async with that $guest
=> 8b5645c2-12e5-4ec7-9350-08adb3e8cb0f
Extends on_shutdown by $guest
LOOPS UP
$guests still full
Then counts current $on_shutdown vs $PARALLEL_SHUTDOWN target - still some to go.
Again pops one and shrinks $guests
Checks if this popped val is already in $on_shutdown
Gets a guest name
Calls shutdown_guest_async with that $guest
=> ef55638c-926a-4d43-9790-99aae3010951
Extends on_shutdown by $guest
# Saves current on_shutdown
on_shutdown_prev=$on_shutdown
# Determines how much of current on_shutdown are still running and sets $guests_shutting_down to remaining ones
check_guests_shutdown "$uri" "$on_shutdown"
Initially both shutdown guests are still on, so they are kept and nothing is reported as shut down.
For now the inner loop repetition does not make progress due to on_shutdown already being 2 matching 2 of $PARALLEL_SHUTDOWN
On the next check of check_guests_shutdown default 8b5645c2-12e5-4ec7-9350-08adb3e8cb0f ef55638c-926a-4d43-9790-99aae3010951 the guests are down
on_shutdown= is set to an empty value
on_shutdown_prev= 8b5645c2-12e5-4ec7-9350-08adb3e8cb0f ef55638c-926a-4d43-9790-99aae3010951 (from before the check)
print_guests_shutdown reports the two guests as GONE
LOOPS UP
It detects that on shutdown is now count 0
FIND#1: the check against $guests is not the long VAR
Something modified $guests to the value of on_shutdown and this is what breaks progress.
From here is is an infnite loop until timeout.
This is a scope bug in this §%$/&( script.
I hate to touch it BTW as I did when fixing the last issue, but bugs needs fixing.
list_guests lists all 6 12e5-4ec7- 9350-08adb3e8cb 0f 926a-4d43- 9790-99aae30109 51 8d86-4114- 84db-02f1f655d2 79 2deb-44c8- 9cd3-727882b140 b9 b40c-433e- b656-3519626dcb f3 a4b7-4044- b4ce-2ceb934c1e 4b
8b5645c2-
ef55638c-
119975ea-
afe0321b-
6d0a05d2-
a9224770-
All xenial- testshutdown- * get printed to stdout
Listfile gets URI + guests: 12e5-4ec7- 9350-08adb3e8cb 0f ef55638c- 926a-4d43- 9790-99aae30109 51 119975ea- 8d86-4114- 84db-02f1f655d2 79 afe0321b- 2deb-44c8- 9cd3-727882b140 b9 6d0a05d2- b40c-433e- b656-3519626dcb f3 a9224770- a4b7-4044- b4ce-2ceb934c1e 4b
+ echo default 8b5645c2-
shutdown_ guests_ parallel called with: 8b5645c2- 12e5-4ec7- 9350-08adb3e8cb 0f ef55638c- 926a-4d43- 9790-99aae30109 51 119975ea- 8d86-4114- 84db-02f1f655d2 79 afe0321b- 2deb-44c8- 9cd3-727882b140 b9 6d0a05d2- b40c-433e- b656-3519626dcb f3 a9224770- a4b7-4044- b4ce-2ceb934c1e 4b
+ uri=default
+ guests=
on_shutdown= (empty initially)
loops until
$on_shutdown is empty (again)
AND
$guests is empty (expects remove of handled guests)
Then counts current $on_shutdown vs $PARALLEL_SHUTDOWN target.
Makes $guests the arguments vais "set --"
Picks $1 as guest
Shifts $1 out of the args
guests is assigned the remaining guests.
TL;DR This popped $1 into $guest and shrunk $guests by 1
Checks if this popped val is already in $on_shutdown guest_async with that $guest 12e5-4ec7- 9350-08adb3e8cb 0f
Gets a guest name
Calls shutdown_
=> 8b5645c2-
Extends on_shutdown by $guest
LOOPS UP
$guests still full
Then counts current $on_shutdown vs $PARALLEL_SHUTDOWN target - still some to go.
Again pops one and shrinks $guests
Checks if this popped val is already in $on_shutdown guest_async with that $guest 926a-4d43- 9790-99aae30109 51
Gets a guest name
Calls shutdown_
=> ef55638c-
Extends on_shutdown by $guest
Now it has 2 (of 2) async shutdowns started
sleep 1
Counts remaining guests = 4
Counts on shutdown = 2
Reports on progress in regard to timeout
# Saves current on_shutdown prev=$on_ shutdown
on_shutdown_
# Determines how much of current on_shutdown are still running and sets $guests_ shutting_ down to remaining ones guests_ shutdown "$uri" "$on_shutdown"
check_
on_shutdown= "$guests_ shutting_ down" guests_ shutdown "$uri" "$on_shutdown_prev" "$on_shutdown"
print_
Initially both shutdown guests are still on, so they are kept and nothing is reported as shut down.
For now the inner loop repetition does not make progress due to on_shutdown already being 2 matching 2 of $PARALLEL_SHUTDOWN
On the next check of check_guests_ shutdown default 8b5645c2- 12e5-4ec7- 9350-08adb3e8cb 0f ef55638c- 926a-4d43- 9790-99aae30109 51 the guests are down
on_shutdown= is set to an empty value 12e5-4ec7- 9350-08adb3e8cb 0f ef55638c- 926a-4d43- 9790-99aae30109 51 (from before the check)
on_shutdown_prev= 8b5645c2-
print_ guests_ shutdown reports the two guests as GONE
LOOPS UP
It detects that on shutdown is now count 0
FIND#1: the check against $guests is not the long VAR
Something modified $guests to the value of on_shutdown and this is what breaks progress.
From here is is an infnite loop until timeout.
This is a scope bug in this §%$/&( script.
I hate to touch it BTW as I did when fixing the last issue, but bugs needs fixing.