GutoVeronezi opened a new pull request, #8605:
URL: https://github.com/apache/cloudstack/pull/8605

   ### Description
   
   Currently, almost every command MS sends to the agents uses the global 
setting `wait` as the timeout's value. That means, if you want to extend or 
shorten the execution of a command, you will affect every other command. 
Therefore, currently we **do not** have a way to customize the timeout for 
specific commands.
   
   For some edge cases, we have "wait"/"timeout" hardcoded values or values 
that come from global settings to set the commands timeout, like for 
`GetAutoScaleMetricsCommand` and for `MigrateCommand`. Currently, we have 385 
classes that extend `com.cloud.agent.api.Command` (I skipped classes that 
extend `com.cloud.agent.api.Answer`); therefore, externalizing global settings 
for each command  to provide flexibility is not feasible; however, we can reach 
flexibility by other means. 
   
   Currently, if we do not set a `wait` to the command, `AgentManagerImpl` will 
fallback to the `wait` global setting:
   
   
https://github.com/apache/cloudstack/blob/af8a582055c4194d1e42c8c1abd96969692046ed/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java#L441-L443
    
   I propose to create a table of `command_timeout` to store the classpath of 
the command and its wait/timeout. Then, instead of fall backing directly to the 
`wait` global setting, we check if there is an entry of the command in this 
table. If it exists, then we use the entry's value; otherwise, we fall back to 
the `wait` global setting (the current behavior). Thus, we can change the 
commands wait/timeout on demand and in a flexible way.
   
   The first step of the proposal is to create the table and changing 
`AgentManagerImpl` to check the table. Some entries will already be created for 
hardcoded values. Further steps can be found in #8506.
   
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [X] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [x] Minor
   
   ### How Has This Been Tested?
   
   TBD


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to