Skip to content

Commit fef03ae

Browse files
authored
Merge pull request #67 from dmitrygusev/elb-timeouts
Fix ALB/ELB wait timeouts
2 parents 37b3be0 + 356dad6 commit fef03ae

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

load-balancing/elb-v2/common_functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ reset_waiter_timeout() {
452452
msg "Calculating timeout for register instance in target group $target_group_name"
453453
local health_check_interval=$(echo $target_group_info | awk '{print $1}')
454454
local health_check_timeout=$(echo $target_group_info | awk '{print $2}')
455-
local health_check_threshold=$(echo $target_group_info | awk '{print $2}')
455+
local health_check_threshold=$(echo $target_group_info | awk '{print $3}')
456456
local timeout=$(echo "$health_check_threshold * ( $health_check_timeout + $health_check_interval )" | /usr/bin/bc)
457457
elif [ "$state_name" == "unused" ]; then
458458
msg "Getting target group arn for target group $target_group_name"

load-balancing/elb/common_functions.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,15 @@ reset_waiter_timeout() {
445445
if [ "$state_name" == "InService" ]; then
446446

447447
# Wait for a health check to succeed
448-
local timeout=$($AWS_CLI elb describe-load-balancers \
448+
local elb_info=$($AWS_CLI elb describe-load-balancers \
449449
--load-balancer-name $elb \
450-
--query \'LoadBalancerDescriptions[0].HealthCheck.Timeout\')
450+
--query \'LoadBalancerDescriptions[0].HealthCheck.[HealthyThreshold,Interval,Timeout]\' \
451+
--output text)
452+
453+
local health_check_threshold=$(echo $elb_info | awk '{print $1}')
454+
local health_check_interval=$(echo $elb_info | awk '{print $2}')
455+
local health_check_timeout=$(echo $elb_info | awk '{print $3}')
456+
local timeout=$((health_check_threshold * (health_check_interval + health_check_timeout)))
451457

452458
elif [ "$state_name" == "OutOfService" ]; then
453459

0 commit comments

Comments
 (0)