abh1sar commented on code in PR #12355:
URL: https://github.com/apache/cloudstack/pull/12355#discussion_r2661891786
##########
setup/bindir/cloud-sysvmadm.in:
##########
@@ -184,59 +184,38 @@ stop_start_system() {
stop_start_router() {
prepare_ids_clause
router=(`mysql -h $db --user=$user --password=$password
--skip-column-names -U cloud -e "select uuid from vm_instance where
state=\"Running\" and type=\"DomainRouter\"$zone$vmidsclause"`)
- length_router=(${#router[@]})
+ length_router=${#router[@]}
echo -e "\nStopping and starting $length_router running routing
vm(s)$inzone$withids... "
echo -e "[$(date "+%Y.%m.%d-%H.%M.%S")] Stopping and starting
$length_router running routing vm(s)$inzone$withids... " >>$LOGFILE
#Spawn reboot router in parallel - run commands in <n> chunks - number of
threads is configurable
+ if [ $maxthreads -gt $length_router ]; then
+ maxthreads=$length_router
+ fi
Review Comment:
Realistically even though user might have requested N threads, only R (no.
of routers) thread can be dispatched. So, maxthreads is capped by number of
routers.
--
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]