If the ank apply command applies a workload and during the workload is deleted during the apply, then the table output of ank apply shows the workload with workload state Removed, but it hangs and the spinner is still running.
Current Behavior
Ank apply hangs when it runs and a workload it touches is deleted.
Expected Behavior
The Ank apply command shall not hang and return if the workload it touches was deleted.
Steps to Reproduce
The situation can be easily reproduced with forcing retries when initially starting a workload, because then there is enough time for a human to enter the delete command during the ank apply runs. Of course, the bug can also be reproduced without using the retry feature but with scripting.
Start the Ankaios server: ./ank-server
Start the Ankaios agent: ./ank-agent --name agent_A
Apply the manifest invalidworkload.yml mentioned below: ./ank apply invalidworkload.yml
Start a second shell and enter a delete of the workload inside the manifest: ./ank delete workload invalidworkload
Switch back to the ank apply terminal window and you will see that the ank apply command still runs and stucks but the workload has already the workload state Removed because of the delete request in the other shell.
Context (Environment)
All supported platforms are affected, but detected with: Linux amd64 (64 bit)
Ank apply CLI command
In general, it must be discussed how the ank apply reacts to changed workloads during it runs (not only when deleting a workload) and if we consider this as a bug or expected behavior.
If the
ank apply
command applies a workload and during the workload is deleted during the apply, then the table output ofank apply
shows the workload with workload stateRemoved
, but it hangs and the spinner is still running.Current Behavior
Ank apply hangs when it runs and a workload it touches is deleted.
Expected Behavior
The Ank apply command shall not hang and return if the workload it touches was deleted.
Steps to Reproduce
The situation can be easily reproduced with forcing retries when initially starting a workload, because then there is enough time for a human to enter the delete command during the ank apply runs. Of course, the bug can also be reproduced without using the retry feature but with scripting.
./ank-server
./ank-agent --name agent_A
invalidworkload.yml
mentioned below:./ank apply invalidworkload.yml
./ank delete workload invalidworkload
Removed
because of the delete request in the other shell.Context (Environment)
All supported platforms are affected, but detected with: Linux amd64 (64 bit) Ank apply CLI command
Logs
Hanging ank apply screenshot:
Additional Information
Final result
To be filled by the one closing the issue.