Closed inf17101 closed 4 months ago
The reason is that the state checker has sent the Stopping(Stopping)
or Failed(ExecFailed)
execution state because podman has turned the state of the container to one of those states before actually removing the container. The tokio::select inside WorkloadControlLoop listens to those workload states and forwards them even if the workload was already updated inside the WorkloadControlLoop.
I implement and test a fix to check in the WorkloadControlLoop if the workload state is still matching to the actual managed workload of the control loop.
@krucod3: I decided on a fix that prevents the old workload state from being sent at the workload state sender (WorkloadControlLoop
). Not at the workload state receiver (transition function). It is only the production code change for now and seems to work when testing the User tutorial again where the issue was noticed. What do you think?
If it's fine, I continue with tests and req adaptions.
PR was reviewed and merged.
When updating the
speed-provider
to use the auto mode in the user tutorial with theank apply
command the workload is updated successfully, but the output ofank apply
andank get workloads
shows the old workload of speed-provider asStopping(Stopping)
orFailed(ExecFailed)
even after the old workload was removed due to the update operation.Current Behavior
Expected Behavior
Steps to Reproduce
ank apply
output and executeank get workloads
afterwardsIf the user tutorial is executed without the Ankaios agent running with root privileges and using podman as root user the execution state is
Failed(ExecFailed)
instead ofStopping(Stopping)
.Context (Environment)
Linux amd64 Ank cli
Logs
Additional Information
Final result
The WorkloadControlLoop was changed to check the validity of the WorkloadState it has inside its buffers to ensure that no old WorkloadStates are forwarded after its internal workload was updated already. Now, when executing the ank apply command the old workload is shown as
Removed
and notStopping
anymore and the updated workload is shown with workload stateRunning(Ok)
.