This commit fixes a memory leak that happens if the PagerDuty endpoint returns a 429 HTTP status code. It was not verified whether the error happens with other status codes as well.
I verified the correctness of this fix by running the following test:
Without the fix, this produces the following output:
num goroutines: 6
num goroutines: 8
num goroutines: 10
num goroutines: 12
num goroutines: 14
num goroutines: 16
num goroutines: 18
num goroutines: 20
num goroutines: 22
num goroutines: 24
...
With the fix, this produces the following output:
num goroutines: 8
num goroutines: 8
num goroutines: 8
num goroutines: 8
num goroutines: 8
num goroutines: 8
num goroutines: 6
num goroutines: 6
num goroutines: 6
num goroutines: 6
num goroutines: 5
num goroutines: 6
...
Yeah thank you for the fix @attilakunelwood! We are going to have one more look at this and see if there isn't a more centralized location for us to put this fix.
This commit fixes a memory leak that happens if the PagerDuty endpoint returns a 429 HTTP status code. It was not verified whether the error happens with other status codes as well.
I verified the correctness of this fix by running the following test:
Without the fix, this produces the following output:
With the fix, this produces the following output: