Skip to content

Commit 6b1b71e

Browse files
committed
Fix context cancelling with DescribeNetworkInterface context timeout
1 parent 89bb816 commit 6b1b71e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/awsutils/awsutils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1741,8 +1741,8 @@ func (cache *EC2InstanceMetadataCache) DescribeAllENIs(ctx context.Context) (Des
17411741
start := time.Now()
17421742

17431743
reqCtx, cancel := context.WithTimeout(ctx, 10*time.Second)
1744-
defer cancel()
17451744
ec2Response, err = cache.ec2SVC.DescribeNetworkInterfaces(reqCtx, input)
1745+
cancel()
17461746
prometheusmetrics.Ec2ApiReq.WithLabelValues("DescribeNetworkInterfaces").Inc()
17471747
prometheusmetrics.AwsAPILatency.WithLabelValues("DescribeNetworkInterfaces", fmt.Sprint(err != nil), awsReqStatus(err)).Observe(msSince(start))
17481748
if err == nil {

0 commit comments

Comments
 (0)