apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.06k stars 1.1k forks source link

Add timeout for handling of Command on agent's implementation #8011

Open vishesh92 opened 1 year ago

vishesh92 commented 1 year ago
ISSUE TYPE
COMPONENT NAME
Agent, ServerResource
CLOUDSTACK VERSION
All versions
CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY

The value for wait set in Command is not honored by agents (SSVM, host agent, etc.) while processing the request. These requests can also pile up if the same request is sent multiple times because of retries by user or the management server itself. This can potentially cause issues on SSVM and agents while executing long tasks leading to high wait times for commands to get executed on host agents, ssvm, etc.

STEPS TO REPRODUCE
  1. Add a sleep in a ssvm command for 60 seconds and a log line before and after the sleep to check number of executions for that command.
  2. Send 100 requests in parallel which will execute the above ssvm command with cmd.setWait(5).
  3. Check logs on ssvm to check the actual number of requests received.

Note: The above example is for a Command for which executeInSequence is false.

EXPECTED RESULTS
If the request on management server times out in 5 seconds, the processing of command on SSVM should stop after 5 seconds as well.
ACTUAL RESULTS

The number of requests received on the SSVM would be executing these requests in batches of 10 requests or so. The requests would still get processed even if the server itself has timed out and no longer waiting for the answer. You will the log for both before sleep and after sleep.

vishesh92 commented 1 year ago

cc: @DaanHoogland

DaanHoogland commented 1 year ago

@vishesh92 I think you are right in your expectations. There are some more cases to define/consider;